12
12
namespace LucaDegasperi \OAuth2Server ;
13
13
14
14
use Illuminate \Contracts \Foundation \Application ;
15
+ use Illuminate \Foundation \Application as LaravelApplication ;
15
16
use Illuminate \Support \ServiceProvider ;
17
+ use Laravel \Lumen \Application as LumenApplication ;
16
18
use League \OAuth2 \Server \AuthorizationServer ;
17
19
use League \OAuth2 \Server \ResourceServer ;
18
20
use League \OAuth2 \Server \Storage \AccessTokenInterface ;
@@ -55,9 +57,9 @@ protected function setupConfig(Application $app)
55
57
{
56
58
$ source = realpath (__DIR__ .'/../config/oauth2.php ' );
57
59
58
- if (class_exists ( ' Illuminate\Foundation\Application ' , false ) && $ app ->runningInConsole ()) {
60
+ if ($ app instanceof LaravelApplication && $ app ->runningInConsole ()) {
59
61
$ this ->publishes ([$ source => config_path ('oauth2.php ' )]);
60
- } elseif (class_exists ( ' Laravel\Lumen\Application ' , false ) ) {
62
+ } elseif ($ app instanceof LumenApplication ) {
61
63
$ app ->configure ('oauth2 ' );
62
64
}
63
65
@@ -75,7 +77,7 @@ protected function setupMigrations(Application $app)
75
77
{
76
78
$ source = realpath (__DIR__ .'/../database/migrations/ ' );
77
79
78
- if (class_exists ( ' Illuminate\Foundation\Application ' , false ) && $ app ->runningInConsole ()) {
80
+ if ($ app instanceof LaravelApplication && $ app ->runningInConsole ()) {
79
81
$ this ->publishes ([$ source => database_path ('migrations ' )], 'migrations ' );
80
82
}
81
83
}
0 commit comments