Added release year to albums

This commit is contained in:
gballan1 2016-11-29 11:43:11 -05:00
parent 27436feba2
commit d2ac8ca371
3 changed files with 6 additions and 2 deletions

View File

@ -19,4 +19,8 @@ class Album extends Eloquent {
return $this->hasMany('Fieldprotocol\Music\Song'); return $this->hasMany('Fieldprotocol\Music\Song');
} }
public function releaseYear() {
return date('%Y', strtotime($this->release_date));
}
} }

View File

@ -60,7 +60,7 @@
<div class="thumbnail shadow-1"> <div class="thumbnail shadow-1">
<img class="album-art" src="{{ album.album_art }}" alt="{{ album.title }}"> <img class="album-art" src="{{ album.album_art }}" alt="{{ album.title }}">
<div class="caption"> <div class="caption">
<h5>{{ album.title }}</h5> <h5>{{ album.title }} ({{ album.releaseYear }})</h5>
</div> </div>
</div> </div>
</div> </div>

View File

@ -60,7 +60,7 @@
<div class="thumbnail shadow-1"> <div class="thumbnail shadow-1">
<img class="album-art" src="{{ album.album_art }}" alt="{{ album.title }}"> <img class="album-art" src="{{ album.album_art }}" alt="{{ album.title }}">
<div class="caption"> <div class="caption">
<h5>{{ album.title }}</h5> <h5>{{ album.title }} ({{ album.releaseYear }})</h5>
</div> </div>
</div> </div>
</div> </div>