|
5 | 5 |
|
6 | 6 | class Service extends ServiceProvider |
7 | 7 | { |
8 | | - protected $defer = false; |
9 | | - |
10 | 8 | public function boot() |
11 | 9 | { |
12 | | - $this->publishes([ |
13 | | - __DIR__ . '/../../config/genealabs-laravel-whoops-atom.php' |
14 | | - => config_path('genealabs-laravel-whoops-atom.php') |
15 | | - ], 'config'); |
16 | | - |
17 | | - config([ |
18 | | - 'app.editor' => function ($file, $line) { |
19 | | - $homestead = rtrim(config('genealabs-laravel-whoops-atom.homestead-sites-path'), '/'); |
20 | | - $local = rtrim(config('genealabs-laravel-whoops-atom.local-sites-path'), '/'); |
21 | | - |
22 | | - if (! $local) { |
23 | | - return ''; |
24 | | - } |
25 | | - |
26 | | - $file = str_replace("{$homestead}/", "{$local}/", $file); |
27 | | - |
28 | | - return "atom://open?url=file://{$file}&line={$line}"; |
29 | | - }, |
30 | | - ]); |
31 | | - } |
32 | | - |
33 | | - public function register() |
34 | | - { |
35 | | - $this->commands(Publish::class); |
36 | | - $this->mergeConfigFrom( |
37 | | - __DIR__ . '/../../config/genealabs-laravel-whoops-atom.php', |
38 | | - 'genealabs-laravel-whoops-atom' |
39 | | - ); |
40 | | - } |
41 | | - |
42 | | - public function provides() : array |
43 | | - { |
44 | | - return ['genealabs-laravel-whoops-atom']; |
| 10 | + if (config('app.env') !== 'production') { |
| 11 | + $this->publishes([ |
| 12 | + __DIR__ . '/../../config/genealabs-laravel-whoops-atom.php' |
| 13 | + => config_path('genealabs-laravel-whoops-atom.php') |
| 14 | + ], 'config'); |
| 15 | + |
| 16 | + config([ |
| 17 | + 'app.editor' => function ($file, $line) { |
| 18 | + $homestead = rtrim(config('genealabs-laravel-whoops-atom.homestead-sites-path'), '/'); |
| 19 | + $local = rtrim(config('genealabs-laravel-whoops-atom.local-sites-path'), '/'); |
| 20 | + |
| 21 | + if (! $local) { |
| 22 | + return ''; |
| 23 | + } |
| 24 | + |
| 25 | + $file = str_replace("{$homestead}/", "{$local}/", $file); |
| 26 | + |
| 27 | + return "atom://open?url=file://{$file}&line={$line}"; |
| 28 | + }, |
| 29 | + ]); |
| 30 | + $this->commands(Publish::class); |
| 31 | + $this->mergeConfigFrom( |
| 32 | + __DIR__ . '/../../config/genealabs-laravel-whoops-atom.php', |
| 33 | + 'genealabs-laravel-whoops-atom' |
| 34 | + ); |
| 35 | + } |
45 | 36 | } |
46 | 37 | } |
0 commit comments