'array', ]; /** * The attributes that should be cast to Enums. * * @var array */ protected $enumCasts = [ 'type' => BreedingPageType::class, 'media_type' => InputType::class ]; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'title', 'headerContent', 'seo_title', 'seo_description', 'headerContent', 'subtitle', 'subtitleContent', 'media_type', 'picture', 'picture_alt', 'picture_title', 'video', 'content', 'status' ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { static::creating(function (self $model) { $model->slug = Str::slug($model->title); OldSlugable::removeSameSlugs($model, $model->slug); }); static::updating(function (self $model) { $model->slug = Str::slug($model->title); if ($model->slug != $model->getOriginal('slug')) { OldSlugable::removeSameSlugs($model, $model->getOriginal('slug')); } OldSlugable::insertSlug($model); }); } /** * Get the route key for the model. * * @return string */ public function getRouteKeyName() { return 'slug'; } /** * Get Blocks Template Data * * @return array */ public static function getBlocks(): array { return [ BreedingBlocType::bloc1()->value => [ 'type' => BreedingBlocType::bloc1(), 'content' => [ 'dropdownArray' => [ 'label' => 'Dropdowns', 'inputType' => InputType::dropdownArray(), 'value' => [] ] ] ] ]; } }