36 lines
822 B
PHP
36 lines
822 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class DisplayPlaylistItem extends Model
|
|
{
|
|
/** @use HasFactory<\Database\Factories\DisplayPlaylistItemFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'display_playlist_id',
|
|
'display_version_id',
|
|
'sort_order',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'sort_order' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function playlist(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DisplayPlaylist::class, 'display_playlist_id');
|
|
}
|
|
|
|
public function module(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DisplayVersion::class, 'display_version_id');
|
|
}
|
|
}
|