Paket 2: konfigurierbare Inhaltsart an Identitaet
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7820bececb
commit
1a2b1298b5
8 files changed
+233
-1
No files matched your search
@@ -3,6 +3,7 @@
|
||||
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
|
||||
@@ -10,6 +11,7 @@ class Composition extends Model
|
||||
protected $fillable = [
|
||||
'designation',
|
||||
'kind',
|
||||
'editorial_content_kind_id',
|
||||
'archived_at',
|
||||
];
|
||||
|
||||
@@ -21,6 +23,11 @@ protected function casts(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function editorialContentKind(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EditorialContentKind::class);
|
||||
}
|
||||
|
||||
public function versions(): HasMany
|
||||
{
|
||||
return $this->hasMany(CompositionVersion::class);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
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;
|
||||
|
||||
@@ -13,6 +14,7 @@ class ContentElement extends Model
|
||||
'output_class',
|
||||
'working_title',
|
||||
'description',
|
||||
'editorial_content_kind_id',
|
||||
'archived_at',
|
||||
];
|
||||
|
||||
@@ -23,6 +25,11 @@ protected function casts(): array
|
||||
];
|
||||
}
|
||||
|
||||
public function editorialContentKind(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EditorialContentKind::class);
|
||||
}
|
||||
|
||||
public function versions(): HasMany
|
||||
{
|
||||
return $this->hasMany(ContentElementVersion::class);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Catalog;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class EditorialContentKind extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'slug',
|
||||
'label',
|
||||
'sort_order',
|
||||
];
|
||||
|
||||
public function compositions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Composition::class);
|
||||
}
|
||||
|
||||
public function contentElements(): HasMany
|
||||
{
|
||||
return $this->hasMany(ContentElement::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public static function selectOptions(): array
|
||||
{
|
||||
return static::query()->orderBy('sort_order')->pluck('label', 'id')->all();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user