diff options
| author | Zach DeCook <zachdecook@gmail.com> | 2018-12-27 01:05:36 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@gmail.com> | 2018-12-27 01:05:36 -0500 |
| commit | 67c377fe1d87bfb127bcbfa952e9119bd341d4e8 (patch) | |
| tree | c9e902fbb34fc4c6aa39b70eef20d2e97c6b53e2 /laravel/app/Song.php | |
| parent | 793f9970376e99e2330d7285734a8966655e55aa (diff) | |
| download | prosongsa-67c377fe1d87bfb127bcbfa952e9119bd341d4e8.tar.gz | |
* Playlists: Set up many to many relationship
Diffstat (limited to 'laravel/app/Song.php')
| -rw-r--r-- | laravel/app/Song.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/laravel/app/Song.php b/laravel/app/Song.php index 876617f..0565ff6 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -7,5 +7,8 @@ use Illuminate\Database\Eloquent\Model; class Song extends Model { public $fillable = ['number', 'title', 'author', 'key', 'text']; - // + public function playlists() + { + return $this->belongsToMany('App\Playlist'); + } } |
