This has nothing to do with your backend. You can manually open the modal after refresh if the form has errors.
@if(session()->has('error')) <script> $('#add_post_modal').modal('show'); </script> @endif
There is no jQuery in Bootstrap 5. :(
Found this article related to your problem :
It doesn't have jQuery, but the concept is the same. You can use plain JS or check Bootstrap's doc on how to do it.
Try this out:
@if(session()->has('error')) <script> var myModal = new bootstrap.Modal(document.getElementById('add_post_modal')); myModal.show(); </script> @endif
Link to the official bootstrap 5 documentation manually open modal
@faisal Please help me with this quetion too. Thanks!
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.