diff --git a/app/Models/Song.php b/app/Models/Song.php index 39f22c43..61bc8ba7 100644 --- a/app/Models/Song.php +++ b/app/Models/Song.php @@ -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);