TemplateOperationServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 2
A bootForConsole() 0 12 1
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