Laravel flash messages not working after update to 3.13
Hello!
I've been using the debugbar for a while now and I have been quite happy so far, thanks for the hard work!
Anyway, I started having issues with my app last week. After rebuilding the containers (and updating the debugbar to the last version, 3.13.3) my app Laravel/Inertia/App suddenly stopped working. Basically, all the flashed messages from Laravel weren't picked up by Inertia, therefore breaking some features in my app.
In particular, I defined a vue component which simply calls a "/test" endpoint when mounted. This endpoint contains the following code:
public function testMethod()
{
session()->put("success", "message1");
return back()->with("testMessage", "message2");
}I then defined an Inertia Middleware to intercept this flashed message and show in the frontend as per their documentation:
public function share(Request $request): array
{
return array_merge(parent::share($request), [
"flash" => function () {
return [
"testMessage" => session()->get("testMessage"),
"success" => session()->get("success"),
"error" => session()->get("error"),
"status" => session()->get("status"),
"data" => session()->get("data")
];
},
]);
}However, the flashed message was never found under any circumstance while this used to work perfectly fine. After a few days of investigations, I realized that reverting the debugbar back to 3.12.4 apparently solves the issue.
Any idea where this behaviour might come from? Thank you!
Source: fruitcake/laravel-debugbar