mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
29 lines
499 B
PHP
29 lines
499 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Traits\CanFilterByUser;
|
|
|
|
class Playlist extends Model
|
|
{
|
|
use CanFilterByUser;
|
|
|
|
protected $hidden = ['user_id', 'created_at', 'updated_at'];
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
];
|
|
|
|
public function songs()
|
|
{
|
|
return $this->belongsToMany(Song::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|