Test auth is binded before detect Auth driver (#946)

* Test `auth` is binded before detect Auth driver

some project may not need Auth service provider

* fix codingstyle
This commit is contained in:
ZhangWei
2020-06-06 22:28:00 +02:00
committed by GitHub
parent 7515cd206d
commit f3e48cbcce
+2 -1
View File
@@ -123,7 +123,8 @@ class Generator
$this->interfaces['\Illuminate\Contracts\Auth\Authenticatable'] = $defaultUserModel;
try {
if (class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true)) {
if (class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true)
&& app()->bound('auth')) {
if (class_exists('\Illuminate\Foundation\Application')) {
$authMethod = version_compare(Application::VERSION, '5.2', '>=') ? 'guard' : 'driver';
} else {