The issue was with order in which the middlewares were being applied. I added
$middlewarePriority to app/Http/Kernel.php and ordered the middlewares in a way that the SetLocale runs first and then HandleInertiaRequests.
See the code snippet below:
protected $middlewarePriority = [ \App\Http\Middleware\SetLocale::class, \App\Http\Middleware\HandleInertiaRequests::class ];
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us
The Laravel portal for problem solving, knowledge sharing and community building.