How to Fix Session store not set on request Laravel 11?



This content originally appeared on DEV Community and was authored by Abdul Wahid Kahar

Add the following code in the bootstrap/app.php file:

use Illuminate\Session\Middleware\StartSession;
$middleware->append(StartSession::class);

Image description

This is because the way we register custom middleware has changed slightly compared to Laravel 10 and earlier versions.

Hope this helps, thank you!


This content originally appeared on DEV Community and was authored by Abdul Wahid Kahar