From 47208936ee3c18745bbd9a753a9cc566648a5e17 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 28 Dec 2018 14:59:54 -0500 Subject: * Links: Make them better show song name instead of title --- laravel/app/Song.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'laravel/app/Song.php') diff --git a/laravel/app/Song.php b/laravel/app/Song.php index 0565ff6..ceaae21 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -11,4 +11,8 @@ class Song extends Model { return $this->belongsToMany('App\Playlist'); } + public function getNameAttribute() + { + return $this->title . ( $this->author ? " ($this->author)" : "" ); + } } -- cgit 1.4.1