Skip to content

Commit

Permalink
Merge pull request #1 from klaravel/patch-1
Browse files Browse the repository at this point in the history
Small Auth Fix
  • Loading branch information
seancheung authored Nov 18, 2016
2 parents 42075a7 + 8782b96 commit 710ec2c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/PrivilegesMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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);
Expand Down

0 comments on commit 710ec2c

Please sign in to comment.