Big commit whatever

This commit is contained in:
2026-06-04 12:44:22 +02:00
parent ee1a87f125
commit 4fb7b1691c
133 changed files with 26137 additions and 1097 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Track extends Model
{
protected $fillable = ['title', 'file_path', 'duration_seconds', 'album_id', 'position'];
public function album(): BelongsTo
{
return $this->belongsTo(Album::class);
}
public function artists(): BelongsToMany
{
return $this->belongsToMany(Artist::class, 'artist_track');
}
public function genres(): BelongsToMany
{
return $this->belongsToMany(Genre::class, 'track_genre');
}
public function likedBy(): BelongsToMany
{
return $this->belongsToMany(User::class, 'likes');
}
}