feat: add detail image media and play list
This commit is contained in:
@@ -13,6 +13,7 @@ class Media extends Model
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'image_id',
|
||||
'detail_image_id',
|
||||
'title',
|
||||
'caption',
|
||||
'type',
|
||||
@@ -42,6 +43,12 @@ public function image()
|
||||
return $this->belongsTo(Image::class);
|
||||
}
|
||||
|
||||
// Image shown on the detail (show-by-id) screen; image() is the list thumbnail.
|
||||
public function detailImage()
|
||||
{
|
||||
return $this->belongsTo(Image::class, 'detail_image_id');
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsToMany(Category::class, 'category_media');
|
||||
|
||||
Reference in New Issue
Block a user