slug = Str::slug($model->firstname . " " . $model->lastname); ToolboxHelper::assertNoInternalBoUrls('testimony', $model->testimony); $model->testimony = clean($model->testimony); $model->banner = FileStorageHelper::storeFile($model, $model->banner); }); static::updating(function (self $model) { $model->slug = Str::slug($model->firstname . " " . $model->lastname); ToolboxHelper::assertNoInternalBoUrls('testimony', $model->testimony); $model->testimony = clean($model->testimony); // * Store new banner if changed if ($model->banner != $model->getOriginal('banner')) { $model->banner = FileStorageHelper::storeFile($model, $model->banner); } }); } }