Add cast to convert Song.length to float

This commit is contained in:
Matthias Gutjahr 2015-12-20 19:09:34 +01:00
parent 6457528990
commit 2a0bd8fcd8

View file

@ -20,6 +20,13 @@ class Song extends Model
*/
protected $hidden = ['lyrics', 'created_at', 'updated_at', 'path', 'mtime'];
/**
* @var array
*/
protected $casts = [
'length' => 'float'
];
public function album()
{
return $this->belongsTo(Album::class);