defaultView(static::BUTTON_VIEW); $this->failureNotification(fn (Notification $notification): Notification => $notification); $this->successNotification(fn (Notification $notification): Notification => $notification); } /** * @param array $parameters */ public function call(array $parameters = []): mixed { return $this->evaluate($this->getActionFunction(), $parameters); } public function cancel(bool $shouldRollBackDatabaseTransaction = false): void { throw (new Cancel)->rollBackDatabaseTransaction($shouldRollBackDatabaseTransaction); } public function halt(bool $shouldRollBackDatabaseTransaction = false): void { throw (new Halt)->rollBackDatabaseTransaction($shouldRollBackDatabaseTransaction); } /** * @deprecated Use `halt()` instead. */ public function hold(): void { $this->halt(); } public function success(): void { $this->sendSuccessNotification(); $this->dispatchSuccessRedirect(); } public function failure(): void { $this->sendFailureNotification(); $this->dispatchFailureRedirect(); } /** * @return array */ protected function resolveDefaultClosureDependencyForEvaluationByName(string $parameterName): array { return match ($parameterName) { 'arguments' => [$this->getArguments()], 'data' => [$this->getFormData()], 'livewire' => [$this->getLivewire()], default => parent::resolveDefaultClosureDependencyForEvaluationByName($parameterName), }; } }