about summary refs log tree commit diff
path: root/laravel/app/Song.php
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-12-28 14:59:54 -0500
committerZach DeCook <zachdecook@gmail.com>2018-12-28 15:00:11 -0500
commit47208936ee3c18745bbd9a753a9cc566648a5e17 (patch)
tree70a5052a2d2f555a688a69aa41736a861ba93c89 /laravel/app/Song.php
parent159ee785e197ba57600649e53edc01bc3c22bcfd (diff)
downloadprosongsa-47208936ee3c18745bbd9a753a9cc566648a5e17.tar.gz
* Links: Make them better show song name instead of title
Diffstat (limited to 'laravel/app/Song.php')
-rw-r--r--laravel/app/Song.php4
1 files changed, 4 insertions, 0 deletions
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)" : "" );
+    }
 }