codigo actual del servidor, con avances de joan
This commit is contained in:
43
app/Models/SubCategory.php
Normal file
43
app/Models/SubCategory.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\SubCategory
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $category_id
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory whereCategoryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SubCategory whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
|
||||
class SubCategory extends Model
|
||||
{
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
public function products()
|
||||
{
|
||||
return $this->hasMany(Product::class);
|
||||
}
|
||||
|
||||
public function subSubCategories()
|
||||
{
|
||||
return $this->hasMany(SubSubCategory::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user