According to: https://laravel.com/docs/5.4/controllers#controller-middleware
Controllers also allow you to register middleware using a Closure. This provides a convenient way to define a middleware for a single controller without defining an entire middleware class:
$this->middleware(function ($request, $next) {
// ...
return $next($request);
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community