Added store links to msuci player
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
20
app/Fieldprotocol/Music/StoreLink.php
Normal file
20
app/Fieldprotocol/Music/StoreLink.php
Normal 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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user