protected function getSaveFormAction(): Action { return Action::make('save') ->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label')) ->requiresConfirmation() ->action(fn () => $this->save()) ->keyBindings(['mod+s']); }
->relationship()
/*** @param array<string, mixed> $data* @return array<string, mixed>*/protected function mutateFormDataBeforeSave(array $data): array{ // Update the position of $data['repeaters'] here return $data;}
mutateFormDataBeforeSave
save
public function save(): void { try { $data = $this->form->getState(); foreach ($data['categorySteps'] as $index => $step) { $categoryStep = CategoryStep::find($step['id']); if ($categoryStep) { $categoryStep->update(['position' => $index]); } } } catch (Halt $exception) { return; } Notification::make() ->success() ->title("It's Working!") ->send(); }