Total Complexity | 5 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class LaraClientServiceProvider extends ServiceProvider |
||
10 | { |
||
11 | /** |
||
12 | * @return void |
||
13 | */ |
||
14 | public function register(): void |
||
15 | { |
||
16 | $this->mergeConfigFrom(__DIR__.'/../config/lara_client.php', 'lara_client'); |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * @return void |
||
21 | */ |
||
22 | public function boot(): void |
||
23 | { |
||
24 | if ($this->app->runningInConsole()) { |
||
25 | // Publish config file |
||
26 | $this->publishes([ |
||
27 | __DIR__.'/../config/lara_client.php' => config_path('lara_client.php'), |
||
28 | ], 'config'); |
||
29 | // Publish views |
||
30 | $this->publishes([ |
||
31 | __DIR__.'/../resources/views' => resource_path('views/vendor/laraclient'), |
||
32 | ], 'views'); |
||
33 | } |
||
34 | $this->loadMigrationsFrom(__DIR__.'/../migrations'); |
||
35 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'laraclient'); |
||
36 | $this->registerRoutes(); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return void |
||
41 | */ |
||
42 | protected function registerRoutes(): void |
||
43 | { |
||
44 | Route::group($this->routeConfiguration(), function () { |
||
45 | $this->loadRoutesFrom(__DIR__.'/../routes/web.php'); |
||
46 | }); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return string[] |
||
51 | */ |
||
52 | protected function routeConfiguration(): array |
||
56 | // 'middleware'=>'' |
||
57 | ]; |
||
58 | } |
||
59 | } |
||
60 |