From dee3878566d576757c00306a2525437405c0723f Mon Sep 17 00:00:00 2001 From: Propaganistas Date: Wed, 6 Jan 2016 20:31:08 +0100 Subject: [PATCH] Fix Auth driver detection in Laravel 5.2 --- src/Generator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Generator.php b/src/Generator.php index b73881a..f6e73df 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -11,6 +11,7 @@ namespace Barryvdh\LaravelIdeHelper; use Illuminate\Foundation\AliasLoader; +use Illuminate\Foundation\Application; use Illuminate\Config\Repository as ConfigRepository; use Symfony\Component\Console\Output\OutputInterface; @@ -117,7 +118,8 @@ class Generator try{ if (class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true)) { - $class = get_class(\Auth::driver()); + $authMethod = version_compare(Application::VERSION, '5.2', '>=') ? 'guard' : 'driver'; + $class = get_class(\Auth::$authMethod()); $this->extra['Auth'] = array($class); $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class; }