$data * @return array */ protected function mutateFormDataBeforeSave(array $data): array { $policyTypes = $data['scope_jsonb']['policy_types'] ?? []; $data['scope_jsonb'] = ['policy_types' => is_array($policyTypes) ? array_values($policyTypes) : []]; return $data; } protected function afterSave(): void { $record = $this->record; if (! $record instanceof BaselineProfile) { return; } BaselineProfileResource::audit($record, AuditActionId::BaselineProfileUpdated, [ 'baseline_profile_id' => (int) $record->getKey(), 'name' => (string) $record->name, 'status' => (string) $record->status, ]); Notification::make() ->title('Baseline profile updated') ->success() ->send(); } }