*/ protected $fillable = [ 'picture', 'picture_alt', 'picture_title', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::creating(function () { throw new \RuntimeException("Creating a new klub section is not authorized"); }); static::updating(function (self $model) { $model->picture = FileStorageHelper::storeFile($model, $model->picture, true); }); static::updated(function (self $model) { FileStorageHelper::removeOldFile($model, 'picture'); }); static::deleting(function () { throw new \RuntimeException('Deleting the klub section is not authorized'); }); } }