43 lines
833 B
PHP
43 lines
833 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
#[Fillable([
|
|
'broadcast_id',
|
|
'channel_id',
|
|
'title',
|
|
'storage_path',
|
|
'playback_url',
|
|
'duration_seconds',
|
|
'size_bytes',
|
|
'published_at',
|
|
'expires_at',
|
|
])]
|
|
class Vod extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'published_at' => 'datetime',
|
|
'expires_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function broadcast(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Broadcast::class);
|
|
}
|
|
|
|
public function channel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Channel::class);
|
|
}
|
|
}
|