I have javascript that makes Ajax call (it calls call my api) every 3 seconds to update user page.
I am returning a view with flash data that is supposed to be kept for the next requests. It seems the Ajax call clears it and the next request can not be completed.
Is the a way to prevent this?
One way I can think of is to re-flash on an api call, but that seems weird. Any other way?
@danWilcz It isn't weird that you have to re-flash them. Laravel doesn't know that you don't want to use your flash messages for AJAX results. A flash message disappears upon the next request from the same host, whether that is an AJAX request or not. So, if you want to retain them, re-flash them. Easy enough: