Added store links to msuci player

This commit is contained in:
gballan1
2016-12-06 16:48:03 -05:00
parent 5ad45b4a4f
commit 2125e21849
3 changed files with 32 additions and 0 deletions

View File

@ -19,6 +19,10 @@ class Album extends Eloquent {
return $this->hasMany('Fieldprotocol\Music\Song');
}
public function links() {
return $this->hasMany('Fieldprotocol\Music\StoreLink', 'album_id');
}
public function releaseDate() {
return date('F j, Y', strtotime($this->release_date));
}

View File

@ -0,0 +1,20 @@
<?php
namespace Fieldprotocol\Music;
use Illuminate\Database\Eloquent\Model as Eloquent;
class StoreLink extends Eloquent {
protected $table = 'store_links';
protected $fillable = [
'link_name',
'link_ref',
];
public function album() {
return $this->belongsTo('Fieldprotocol\Music\Album', 'album_id');
}
}