From 849990554a3373c39e4bb2e71970852eac6ecdac Mon Sep 17 00:00:00 2001 From: Jean Sacren Date: Wed, 11 Dec 2024 20:45:36 -0700 Subject: [PATCH] Show error upon validation failure On the front end, prompt the user if input left blank. On the back end, display error message when validation requirement is not met. --- resources/views/jobs/create.blade.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/views/jobs/create.blade.php b/resources/views/jobs/create.blade.php index 428489f..b2853c6 100644 --- a/resources/views/jobs/create.blade.php +++ b/resources/views/jobs/create.blade.php @@ -24,8 +24,13 @@ id="title" class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo-600 focus:border-indigo-600 sm:max-w-md sm:text-sm" placeholder="e.g., Petroleum Technician" + required /> + + @error('title') +

{{ $message }}

+ @enderror
@@ -37,8 +42,13 @@ class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo- id="salary" class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo-600 focus:border-indigo-600 sm:max-w-md sm:text-sm" placeholder="e.g., $187,000.00" + required />
+ + @error('salary') +

{{ $message }}

+ @enderror