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/Playlist.php | |
| parent | 793f9970376e99e2330d7285734a8966655e55aa (diff) | |
| download | prosongsa-67c377fe1d87bfb127bcbfa952e9119bd341d4e8.tar.gz | |
* Playlists: Set up many to many relationship
Diffstat (limited to 'laravel/app/Playlist.php')
| -rw-r--r-- | laravel/app/Playlist.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/laravel/app/Playlist.php b/laravel/app/Playlist.php new file mode 100644 index 0000000..7284b0e --- /dev/null +++ b/laravel/app/Playlist.php @@ -0,0 +1,14 @@ +<?php + +namespace App; + +use Illuminate\Database\Eloquent\Model; + +class Playlist extends Model +{ + public $fillable = ['name']; + public function songs() + { + return $this->belongsToMany('App\Song'); + } +} |
