File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace Laravel \Tinker ;
44
5+ use Illuminate \Foundation \Application as LaravelApplication ;
56use Illuminate \Support \ServiceProvider ;
7+ use Laravel \Lumen \Application as LumenApplication ;
68use Laravel \Tinker \Console \TinkerCommand ;
79
810class TinkerServiceProvider extends ServiceProvider
@@ -14,6 +16,22 @@ class TinkerServiceProvider extends ServiceProvider
1416 */
1517 protected $ defer = true ;
1618
19+ /**
20+ * Boot the service provider.
21+ *
22+ * @return void
23+ */
24+ public function boot ()
25+ {
26+ $ source = realpath ($ raw = __DIR__ . '/../config/tinker.php ' ) ?: $ raw ;
27+
28+ if ($ this ->app instanceof LaravelApplication && $ this ->app ->runningInConsole ()) {
29+ $ this ->publishes ([$ source => config_path ('tinker.php ' )]);
30+ } elseif ($ this ->app instanceof LumenApplication) {
31+ $ this ->app ->configure ('tinker ' );
32+ }
33+ }
34+
1735 /**
1836 * Register the service provider.
1937 *
@@ -25,10 +43,6 @@ public function register()
2543 return new TinkerCommand ;
2644 });
2745
28- $ this ->publishes ([
29- __DIR__ . '/../config/tinker.php.stub ' => config_path ('tinker.php ' ),
30- ], 'config ' );
31-
3246 $ this ->commands (['command.tinker ' ]);
3347 }
3448
You can’t perform that action at this time.
0 commit comments