LaravelSearchzyServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 37

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 37
rs 9.328
c 0
b 0
f 0
1
<?php
2
3
namespace Jhormantasayco\LaravelSearchzy;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class LaravelSearchzyServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        /*
17
         * Optional methods to load your package assets
18
         */
19
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'laravel-searchzy');
20
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-searchzy');
21
        // $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
22
        // $this->loadRoutesFrom(__DIR__.'/routes.php');
23
24
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'searchzy');
25
26
        if ($this->app->runningInConsole()) {
27
28
            $this->publishes([
29
                __DIR__ . '/../config/searchzy.php' => config_path('searchzy.php'),
30
            ], 'config');
31
32
            // Publishing the views.
33
            $this->publishes([
34
                __DIR__ . '/../resources/views' => resource_path('views/vendor/searchzy'),
35
            ], 'views');
36
37
            // Publishing assets.
38
            /*$this->publishes([
39
                __DIR__.'/../resources/assets' => public_path('vendor/laravel-searchzy'),
40
            ], 'assets');*/
41
42
            // Publishing the translation files.
43
            /*$this->publishes([
44
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/laravel-searchzy'),
45
            ], 'lang');*/
46
47
            // Registering package commands.
48
            // $this->commands([]);
49
        }
50
    }
51
52
    /**
53
     * Register the service provider.
54
     *
55
     * @return void
56
     */
57
    public function register()
58
    {
59
        // Automatically apply the package configuration
60
        $this->mergeConfigFrom(__DIR__ . '/../config/searchzy.php', 'searchzy');
61
    }
62
}
63