Added models for albums and songs

This commit is contained in:
gballan1 committed 2016-04-20 21:53:00 -04:00
1 parent cdd075f186
commit 904b103f8c
3 files changed
+52 -6

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Fieldprotocol\Music;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Album extends Eloquent {
protected $table = 'albums';
protected $fillable = [
'title',
'description',
'album_art',
'release_date',
];
public function songs() {
return $this->hasMany('FieldProtocol\Music\Song');
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Fieldprotocol\Music;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Song extends Eloquent {
protected $table = 'songs';
protected $fillable = [
'title',
'album_id',
'track_order',
];
public function album() {
return $this->belongsTo('FieldProtocol\Music\Album');
}
}