blob: ceaae21d9651b6088bf8c56afca87a124a192002 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Song extends Model
{
public $fillable = ['number', 'title', 'author', 'key', 'text'];
public function playlists()
{
return $this->belongsToMany('App\Playlist');
}
public function getNameAttribute()
{
return $this->title . ( $this->author ? " ($this->author)" : "" );
}
}
|