44 lines
971 B
PHP
44 lines
971 B
PHP
<?php
|
|
|
|
namespace App\Domain\Catalog;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Composition extends Model
|
|
{
|
|
protected $fillable = [
|
|
'designation',
|
|
'display_title',
|
|
'summary',
|
|
'thumbnail_path',
|
|
'thumbnail_alt',
|
|
'thumbnail_error',
|
|
'public_slug',
|
|
'kind',
|
|
'editorial_content_kind_id',
|
|
'archived_at',
|
|
'working_draft',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'kind' => CompositionKind::class,
|
|
'archived_at' => 'datetime',
|
|
'working_draft' => 'array',
|
|
];
|
|
}
|
|
|
|
public function editorialContentKind(): BelongsTo
|
|
{
|
|
return $this->belongsTo(EditorialContentKind::class);
|
|
}
|
|
|
|
public function versions(): HasMany
|
|
{
|
|
return $this->hasMany(CompositionVersion::class);
|
|
}
|
|
}
|