Level 13
bump
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've created a middleware:
<?php
namespace App\Http\Middleware;
use Closure;
class checkNewEntries
{
public function handle($request, Closure $next)
{
//user is logged into
if($request->session()->get('auth') == true){
die("ohhh middleware");
}
return $next($request);
}
}
I don't use the default laravel auth, since the app itself is very small. When I use this middleware and assign it the global middleware I get this error all the time:
RuntimeException in Request.php line 388:
Session store not set on request.
How to fix this? The main idea behind the middleware is to perform some action if the user is logged into BEFORE the request itself is processed.
Please or to participate in this conversation.