LangSwitcherServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 10
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A publishAssets() 0 5 1
A boot() 0 5 2
A register() 0 3 1
1
<?php
2
3
namespace TopviewDigital\LangSwitcher;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LangSwitcherServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $commands = [
13
        Console\InstallCommand::class,
14
        Console\PublishCommand::class,
15
    ];
16
17
    /**
18
     * Register the service provider.
19
     *
20
     * @return void
21
     */
22
    public function register()
23
    {
24
        $this->commands($this->commands);
25
    }
26
27
    private function publishAssets()
28
    {
29
        $this->publishes(
30
            [
31
                __DIR__ . '/config/lang-switch.php' => config_path('lang-switch.php'),
32
            ]
33
        );
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function boot()
40
    {
41
        $this->loadMigrationsFrom(__DIR__ . '/migration');
42
        if ($this->app->runningInConsole()) {
43
            $this->publishAssets();
44
        }
45
    }
46
}
47