feat: add comment for playlist
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user