diff --git a/src/PrivilegesMiddleware.php b/src/PrivilegesMiddleware.php index 56893f5..b664274 100644 --- a/src/PrivilegesMiddleware.php +++ b/src/PrivilegesMiddleware.php @@ -7,18 +7,6 @@ class PrivilegesMiddleware { - protected $auth; - - /** - * Creates a new instance of the middleware. - * - * @param Guard $auth - */ - public function __construct(Guard $auth) - { - $this->auth = $auth; - } - /** * Handle an incoming request. * @@ -31,7 +19,7 @@ public function __construct(Guard $auth) */ public function handle($request, Closure $next, $pattern, $column = 'name') { - if ($this->auth->guest() || !$request->user()->validate($pattern, $column)) { + if (auth()->guest() || !$request->user()->validate($pattern, $column)) { abort(403); } return $next($request);