TranslationHelperServiceProvider::publishAssets()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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