Level 13
bump
Summer Sale! All accounts are 50% off this week.
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.