40 lines
805 B
PHP
40 lines
805 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class Asset extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
public const TYPES = ['script', 'image', 'video', 'audio', 'other'];
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'video_project_id',
|
||
|
|
'workflow_step_id',
|
||
|
|
'type',
|
||
|
|
'disk_path',
|
||
|
|
'mime_type',
|
||
|
|
'size_bytes',
|
||
|
|
'version',
|
||
|
|
'metadata',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'metadata' => 'array',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function videoProject(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(VideoProject::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function workflowStep(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(WorkflowStep::class);
|
||
|
|
}
|
||
|
|
}
|