Added store links to msuci player
This commit is contained in:
parent
5ad45b4a4f
commit
2125e21849
@ -19,6 +19,10 @@ class Album extends Eloquent {
|
|||||||
return $this->hasMany('Fieldprotocol\Music\Song');
|
return $this->hasMany('Fieldprotocol\Music\Song');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function links() {
|
||||||
|
return $this->hasMany('Fieldprotocol\Music\StoreLink', 'album_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function releaseDate() {
|
public function releaseDate() {
|
||||||
return date('F j, Y', strtotime($this->release_date));
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -28,6 +28,14 @@
|
|||||||
<hr />
|
<hr />
|
||||||
<p id="album-description">{{ albums[0].description }}</p>
|
<p id="album-description">{{ albums[0].description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if albums[0].store_links %}
|
||||||
|
<hr />
|
||||||
|
<ul>
|
||||||
|
{% for link in albums[0].store_links %}
|
||||||
|
<li>Buy on <a href="{{ link.link_ref }}">{{ link.link_name }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
Reference in New Issue
Block a user