*/ protected $fillable = [ 'type', 'title', 'anchor', 'color', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'type' => StaticPageType::class, 'color' => StickiesColorEnum::class, ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::creating(function () { // * Prevent user elevation privileges throw_if( auth('backend')->user() and auth('backend')->user()->role->value() < RoleEnum::conceptor->value(), AuthorizationException::class ); }); static::deleting(function () { // // * Prevent user elevation privileges throw_if( auth('backend')->user() and auth('backend')->user()->role->value() < RoleEnum::conceptor->value(), AuthorizationException::class ); }); } }