33 lines
684 B
PHP
33 lines
684 B
PHP
<?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();
|
|
}
|
|
} |