diff --git a/php-templates/auth.php b/php-templates/auth.php index d26a694..87e4b6a 100644 --- a/php-templates/auth.php +++ b/php-templates/auth.php @@ -6,7 +6,8 @@ return collect(Illuminate\Support\Facades\Gate::abilities()) $policyClass = null; - if (get_class($reflection->getClosureThis()) === Illuminate\Auth\Access\Gate::class) { + $closureThis = $reflection->getClosureThis(); + if ($closureThis && get_class($closureThis) === Illuminate\Auth\Access\Gate::class) { $vars = $reflection->getClosureUsedVariables(); if (isset($vars['callback'])) {