Categories
Laravel Samuel

simple laravel form verification

This post is simply a note of an item I did today to fix a little issue on a select form in laravel:

The issue was form verification on a select drop down box, the default value was passing the verification test since it in fact has a “Value”, solution =


update the drop down to show default wording on the front end but leave a blank value in the form field:

{{ Form::select('sales_counselor', ['' => 'Select Counselor'] + $users,

add a check to make sure the sales counselor field has a value, a check that the default value above will not pass:
'sales_counselor' => 'required|exists:users,id',