I have a following code in my posts.create
action.
// ...
return redirect(route('posts.index'))->with('flashMessage', 'test');
// ...
I expect $flashMessage
variable to be available in the posts.index
view, however, it is not. What am I doing wrong?
P.S
I don't want to set the flash message using Session::flash('flashMessage', 'test')
, because it won't work in case of json responses.