I would guess that another redirect happens before the homepage is displayed and your redirect above, either in a middleware or from the function that should return /.
Flash session doesn't work after redirect
I'm on Episode 48 of Laravel 8 from scratch I followed the tutorial from the beginning however flash session doesn't work for me.
return redirect('/')->with('success','Your account has been created.');
I installed the laravel debugbar. I found out that the flash session only appears once in POST /register and I don't have the flash session on the homepage('/'). And the solution that works for me is to move \Illuminate\Session\Middleware\StartSession::class from web $middlewareGroups to $middleware in app\Http\Kernel.php and it works. Not sure why it didn't work the first time. Obviously, I add all the routes in web.php somehow the flash session didn't get passed on. Now the drawback is that every request will have the class.
Please or to participate in this conversation.