show modal on redirect

Published 1 year ago by

I've searched and my code seems to be correct; BUT my modal isnt opening on redirect. Anyone know why?


add Session::flash('openModal','') in your controller before redeirect

Yeah I narrowed it down prior, i should have stated; I changed the modal script to a simple bootstrap alert and it catches the session and displays the alert. But when I change it back to the modal; it doesnt work.

so my console is giving me this error:

home:539 Uncaught SyntaxError: Invalid or unexpected token

I cleared all the errors, yet the modal is still not opening :\

1 year ago (61,020 XP)

use laracasts/flash


modal is a part of your whole view file , so , if you wanna show a modal , you need to reload the page first .

i suggest you use jquery to trigger it .

I am reloading the page when i redirect back. This modal works when i attach it to a button. just not when I use this open method.

Please sign in or create an account to participate in this conversation.