Skip to content

Commit 9818cc8

Browse files
authored
Update ServiceProvider.php
1 parent 995644e commit 9818cc8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/ServiceProvider.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
namespace Observer\LaravelPdd;
33

44
use EasyPdd\Foundation\Application as Pdd;
5+
use Illuminate\Contracts\Support\DeferrableProvider;
56
use Illuminate\Foundation\Application as LaravelApplication;
67
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
78

89

9-
class ServiceProvider extends LaravelServiceProvider
10+
class ServiceProvider extends LaravelServiceProvider implements DeferrableProvider
1011
{
1112
/**
1213
* Boot the provider.
@@ -15,9 +16,9 @@ public function boot()
1516
{
1617
$source = realpath(__DIR__.'/config.php');
1718

18-
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
19-
$this->publishes([$source => config_path('pdd.php')], 'laravel-pdd');
20-
}
19+
$this->publishes([
20+
__DIR__ . '/config.php' => config_path('pdd.php')
21+
], 'config');
2122

2223
$this->mergeConfigFrom($source, 'pdd');
2324
}
@@ -31,8 +32,10 @@ public function register()
3132
$app = new Pdd(config('pdd'));
3233
return $app;
3334
});
35+
}
3436

35-
$this->app->alias(Pdd::class, 'pdd');
36-
$this->app->alias(Pdd::class, 'easypdd');
37+
public function provides()
38+
{
39+
return ['EasyPdd'];
3740
}
38-
}
41+
}

0 commit comments

Comments
 (0)