mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
30 lines
499 B
PHP
30 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);
|
||
|
}
|
||
|
}
|