TemplateOperationServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace SoufieneSlimi\TemplateOperation;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class TemplateOperationServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Perform post-registration booting of services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'template-operation');
17
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'template-operation');
18
19
        // Publishing is only necessary when using the CLI.
20
        if ($this->app->runningInConsole()) {
21
            $this->bootForConsole();
22
        }
23
    }
24
25
    /**
26
     * Console-specific booting.
27
     *
28
     * @return void
29
     */
30
    protected function bootForConsole()
31
    {
32
        // Publishing the views.
33
        $this->publishes([
34
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/backpack'),
35
        ], 'template-operation.views');
36
37
        // Publishing the translation files.
38
        $this->publishes([
39
            __DIR__.'/../resources/lang' => resource_path('lang/vendor/backpack'),
40
        ], 'template-operation.lang');
41
    }
42
}
43