From b412ad3fca9c678b05f43bbba26fbb78ee68a85e Mon Sep 17 00:00:00 2001 From: weeb Date: Fri, 30 May 2025 14:18:45 +0200 Subject: [PATCH] Redirect to status page if application has been submitted --- app/Livewire/ApplicationForm.php | 6 +- .../views/livewire/application-form.blade.php | 62 ++++++++----------- .../livewire/application-status.blade.php | 9 +++ 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/app/Livewire/ApplicationForm.php b/app/Livewire/ApplicationForm.php index b047770..4279763 100644 --- a/app/Livewire/ApplicationForm.php +++ b/app/Livewire/ApplicationForm.php @@ -21,8 +21,6 @@ class ApplicationForm extends Component public $message = ''; - public $applicationUuid; - public $captcha; public $captchaInput; @@ -71,9 +69,9 @@ class ApplicationForm extends Component ]); } - $this->applicationUuid = (string) $application->uuid; - $this->reset(['photos', 'message', 'captchaInput']); + + return redirect("/application-status/{$application->uuid}")->with('status', 'created'); } public function render() diff --git a/resources/views/livewire/application-form.blade.php b/resources/views/livewire/application-form.blade.php index 959fd5a..bcf6fec 100644 --- a/resources/views/livewire/application-form.blade.php +++ b/resources/views/livewire/application-form.blade.php @@ -1,49 +1,37 @@
- @if ($applicationUuid) - - Your application has been submitted. - - You can check its status here: View Application Status - -
Please save or bookmark that link, as the approval process can take 24-48 hours. -
-
- @else -
-
- +
+ - + - - - @if ($photos) -
- Photo Preview -
- @foreach ($photos as $photo) - - @endforeach -
-
- @endif + + @if ($photos)
-
- - captcha + Photo Preview +
+ @foreach ($photos as $photo) + + @endforeach
+ @endif + +
+
+ + captcha +
- Submit Application - - @endif +
+ Submit Application +
diff --git a/resources/views/livewire/application-status.blade.php b/resources/views/livewire/application-status.blade.php index 7eb7e40..c865ffe 100644 --- a/resources/views/livewire/application-status.blade.php +++ b/resources/views/livewire/application-status.blade.php @@ -1,5 +1,14 @@
+ @if (session('status')) + + Your application has been submitted. + + Please bookmark this page, as the approval process can take up to 24 hours. + + + @endif + @if ($application->status === 0) Application pending