TranslationHelperServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

3 Methods

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