Skip to content

Commit

Permalink
Update ServiceProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Observer5 authored May 9, 2022
1 parent 995644e commit 9818cc8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
namespace Observer\LaravelPdd;

use EasyPdd\Foundation\Application as Pdd;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;


class ServiceProvider extends LaravelServiceProvider
class ServiceProvider extends LaravelServiceProvider implements DeferrableProvider
{
/**
* Boot the provider.
Expand All @@ -15,9 +16,9 @@ public function boot()
{
$source = realpath(__DIR__.'/config.php');

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

$this->mergeConfigFrom($source, 'pdd');
}
Expand All @@ -31,8 +32,10 @@ public function register()
$app = new Pdd(config('pdd'));
return $app;
});
}

$this->app->alias(Pdd::class, 'pdd');
$this->app->alias(Pdd::class, 'easypdd');
public function provides()
{
return ['EasyPdd'];
}
}
}

0 comments on commit 9818cc8

Please sign in to comment.