Skip to content

Commit

Permalink
Refactor redirect route in FormsModal.php to use the correct route fo…
Browse files Browse the repository at this point in the history
…r the thank-you page (#25)

* Refactor redirect route in FormsModal.php to use the correct route for the thank-you page, improving code accuracy and maintainability.

* Fix styling

---------

Co-authored-by: thejmitchener <thejmitchener@users.noreply.github.com>
  • Loading branch information
thejmitchener and thejmitchener authored Aug 6, 2024
1 parent 23263ce commit 4665fc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/FormsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function bootingPackage(): void
$this->app->singleton(FormsHandlerService::class, FormsSubmitService::class);

$this->app->singleton(FormsValidationRuleService::class, function ($app) {
return new FormsValidationRuleService();
return new FormsValidationRuleService;
});

if (class_exists(GoogleTagManagerServiceProvider::class)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Livewire/FormsModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function handleFormSubmission()
}

if (is_array($result) && $result['status'] === 'success') {
return redirect()->route('thank-you')->with('status', 'success');
return redirect()->route('forms.thank-you')->with('status', 'success');
} else {
Log::error('Error processing form: '.($result['message'] ?? 'Unknown error'));

Expand Down

0 comments on commit 4665fc3

Please sign in to comment.