Support the ongoing development of Laravel.io →
Blade Validation
Last updated by @ajax30 3 months ago.
0

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
0

There is no jQuery in Bootstrap 5. :(

0

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.

0

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

0
Solution selected by @ajax30

@faisal Please help me with this quetion too. Thanks!

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

Razvan Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.