File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ namespace Observer \LaravelPdd ;
3+
4+ use Illuminate \Support \Facades \Facade as LaravelFacade ;
5+
6+ class Facade extends LaravelFacade
7+ {
8+ /**
9+ * @return string
10+ */
11+ public static function getFacadeAccessor ()
12+ {
13+ return 'easy.pdd ' ;
14+ }
15+ }
Original file line number Diff line number Diff line change 22namespace Observer \LaravelPdd ;
33
44use EasyPdd \Foundation \Application ;
5+ use Illuminate \Foundation \Application as LaravelApplication ;
56use Illuminate \Support \ServiceProvider as LaravelServiceProvider ;
67
78
@@ -12,15 +13,21 @@ class ServiceProvider extends LaravelServiceProvider
1213 */
1314 public function boot ()
1415 {
16+ $ source = realpath (__DIR__ .'/config.php ' );
1517
18+ if ($ this ->app instanceof LaravelApplication && $ this ->app ->runningInConsole ()) {
19+ $ this ->publishes ([$ source => config_path ('pdd.php ' )], 'laravel-pdd ' );
20+ }
21+
22+ $ this ->mergeConfigFrom ($ source , 'pdd ' );
1623 }
1724
1825 /**
1926 * Register the provider.
2027 */
2128 public function register ()
2229 {
23- $ this ->app ->singleton (Application::class , function ($ laravelApp ) {
30+ $ this ->app ->singleton (' easy.pdd ' , function ($ laravelApp ) {
2431 $ app = new Application (config ('pdd ' ));
2532 return $ app ;
2633 });
You can’t perform that action at this time.
0 commit comments