950 0 0 0
Last Updated : 2025-04-29 00:41:13
how to show right modal based on right error type specially in case that there are 2 modals on the same page
1- use named error bags in one form as
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'phone' => ['required', 'string', 'min:11', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
])->validateWithBag('registerErrors'); //this is the error bag
after that you will provide in your blade this code
@if( $errors->registerErrors->all() ) // this registerErrors is the name of error bag
<script>
$(document).ready(function() {
$('#signupModal').modal('show');
});
</script>
@endif
the last thing .. this will provide an error with validate on registersusers.php file in vendor/ui/auth-backend/registersusers.php -> go and delete this validate()