feat: add detail image media and play list

This commit is contained in:
2026-06-06 19:08:27 +03:30
parent 0b578e15dd
commit fcf9c35697
5 changed files with 91 additions and 10 deletions
+7
View File
@@ -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');