feat: add comment for playlist

This commit is contained in:
2026-05-30 08:42:30 +03:30
parent 2352c34062
commit bac1e46848
3 changed files with 45 additions and 15 deletions
+8 -1
View File
@@ -5,8 +5,10 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; // ← Add this
use Illuminate\Database\Eloquent\Relations\HasMany; // ← Add this
use App\Traits\HasComments; // Add this
class MusicPlaylist extends Model
{
use HasComments;
protected $table = 'music_playlists';
protected $fillable = [
@@ -17,7 +19,12 @@ class MusicPlaylist extends Model
'is_active' => 'boolean',
'order' => 'integer',
];
protected $appends = [
'comments_count',
'has_user_commented',
'user_comment',
'user_comment_id'
];
public function category(): BelongsTo
{
return $this->belongsTo(MusicCategory::class, 'category_id');