How do we make filters in Laravel 5? Is the idea of filters going away?
For the comment on before/after.
From the link above :
In Middleware..
#Before
public function handle($request, Closure $next)
{
//Do stuff
return $request;
}
#After
public function handle($request, Closure $next)
{
$response = $next($request);
// Do stuff {on $response}
return $response;
}
Using ['middleware' => 'shortName']
should treat it accordingly.