Files
laraundfelix/app/Domain/Catalog/ContentElement.php
T
LarsandCursor 5e763d15ec
Deploy Test / test (push) Successful in 17s
Deploy Test / deploy (push) Successful in 25s
Ergaenze Stammdaten, Suche, Dimensionen, Abdeckung und Ausgabenachweis
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 08:24:23 +01:00

45 lines
1007 B
PHP

<?php
namespace App\Domain\Catalog;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class ContentElement extends Model
{
protected $fillable = [
'kind',
'output_class',
'working_title',
'display_title',
'description',
'summary',
'editorial_content_kind_id',
'archived_at',
];
protected function casts(): array
{
return [
'archived_at' => 'datetime',
];
}
public function editorialContentKind(): BelongsTo
{
return $this->belongsTo(EditorialContentKind::class);
}
public function versions(): HasMany
{
return $this->hasMany(ContentElementVersion::class);
}
public function pillars(): BelongsToMany
{
return $this->belongsToMany(Pillar::class)->orderBy('pillars.name');
}
}