mirror of
https://github.com/koel/koel
synced 2024-12-30 14:33:06 +00:00
29 lines
499 B
PHP
29 lines
499 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\CanFilterByUser;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
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);
|
|
}
|
|
}
|