Conditions | 3 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace GeneaLabs\LaravelWhoopsAtom\Providers; |
||
8 | public function boot() |
||
9 | { |
||
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 | ); |
||
38 |