Skip to content

Commit 5b68f39

Browse files
ShawnCZekbarryvdh
authored andcommitted
Fix for policies (barryvdh#860)
Policies cannot be used now due to this reason. And additionally, the method `Auth::user()` returns the class `Authenticatable` (which is used in gates), not `Authorizable`. Also, I believe the class `Authenticatable` should be used since it is checking its instance on the line 33.
1 parent 59d310c commit 5b68f39

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/DataCollector/GateCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Barryvdh\Debugbar\DataFormatter\SimpleFormatter;
66
use DebugBar\DataCollector\MessagesCollector;
77
use Illuminate\Contracts\Auth\Access\Gate;
8-
use Illuminate\Contracts\Auth\Access\Authorizable;
98
use Illuminate\Contracts\Auth\Authenticatable;
109
use Symfony\Component\VarDumper\Cloner\VarCloner;
1110

@@ -24,7 +23,7 @@ public function __construct(Gate $gate)
2423
$gate->after([$this, 'addCheck']);
2524
}
2625

27-
public function addCheck(Authorizable $user = null, $ability, $result, $arguments = [])
26+
public function addCheck(Authenticatable $user = null, $ability, $result, $arguments = [])
2827
{
2928
$userKey = 'user';
3029
$userId = null;

0 commit comments

Comments
 (0)