Total Complexity | 3 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 66.67% |
Changes | 0 |
1 | <?php |
||
20 | class Playlist extends Model |
||
21 | { |
||
22 | use CanFilterByUser; |
||
23 | |||
24 | protected $hidden = ['user_id', 'created_at', 'updated_at']; |
||
25 | protected $guarded = ['id']; |
||
26 | protected $casts = [ |
||
27 | 'user_id' => 'int', |
||
28 | 'rules' => 'array', |
||
29 | ]; |
||
30 | protected $appends = ['is_smart']; |
||
31 | |||
32 | 3 | public function songs(): BelongsToMany |
|
33 | { |
||
34 | 3 | return $this->belongsToMany(Song::class); |
|
35 | } |
||
36 | |||
37 | public function user(): BelongsTo |
||
38 | { |
||
39 | return $this->belongsTo(User::class); |
||
40 | } |
||
41 | |||
42 | 4 | public function getIsSmartAttribute(): bool |
|
45 | } |
||
46 | } |
||
47 |