feat: add sub category for media
This commit is contained in:
@@ -14,6 +14,7 @@ class Media extends Model
|
||||
'user_id',
|
||||
'image_id',
|
||||
'category_id',
|
||||
'subcategory_id',
|
||||
'title',
|
||||
'caption',
|
||||
'type',
|
||||
@@ -48,6 +49,11 @@ public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
public function subCategory()
|
||||
{
|
||||
return $this->belongsTo(SubCategory::class, 'subcategory_id');
|
||||
}
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany(Tag::class, 'media_tag');
|
||||
|
||||
Reference in New Issue
Block a user