Backend for songs.zachdecook.com
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)" : "" );
+ }
}