39 lines
891 B
PHP
39 lines
891 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class VideoProject extends Model
|
||
|
|
{
|
||
|
|
use HasFactory, SoftDeletes;
|
||
|
|
|
||
|
|
public const STATUSES = ['draft', 'in_progress', 'completed', 'archived'];
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'title',
|
||
|
|
'description',
|
||
|
|
'status',
|
||
|
|
'workflow_template_id',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function workflowTemplate(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(WorkflowTemplate::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function steps(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(WorkflowStep::class)->orderBy('order');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function assets(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(Asset::class);
|
||
|
|
}
|
||
|
|
}
|