EticketServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 9.28
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
3
/**
4
 * Author: Emmanuel Paul Mnzava
5
 * Twitter: @epmnzava
6
 * Github:https://github.com/dbrax/eticket
7
 * Email: [email protected]
8
 * 
9
 */
10
11
 
12
namespace Epmnzava\Eticket;
13
14
use Illuminate\Support\ServiceProvider;
15
16
class EticketServiceProvider extends ServiceProvider
17
{
18
    /**
19
     * Bootstrap the application services.
20
     */
21
    public function boot()
22
    {
23
        /*
24
         * Optional methods to load your package assets
25
         */
26
        // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'eticket');
27
        // $this->loadViewsFrom(__DIR__.'/../resources/views', 'eticket');
28
        // $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
29
        // $this->loadRoutesFrom(__DIR__.'/routes.php');
30
31
        if ($this->app->runningInConsole()) {
32
            $this->commands([
33
                FeedInTimezone::class,
34
            ]);
35
        }
36
37
        if ($this->app->runningInConsole()) {
38
            $this->publishes([
39
                __DIR__.'/../config/config.php' => config_path('eticket.php'),
40
            ], 'config');
41
42
            // Publishing the views.
43
            /*$this->publishes([
44
                __DIR__.'/../resources/views' => resource_path('views/vendor/eticket'),
45
            ], 'views');*/
46
47
            // Publishing assets.
48
            /*$this->publishes([
49
                __DIR__.'/../resources/assets' => public_path('vendor/eticket'),
50
            ], 'assets');*/
51
52
            // Publishing the translation files.
53
            /*$this->publishes([
54
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/eticket'),
55
            ], 'lang');*/
56
57
            // Registering package commands.
58
            // $this->commands([]);
59
        }
60
    }
61
62
    /**
63
     * Register the application services.
64
     */
65
    public function register()
66
    {
67
        // Automatically apply the package configuration
68
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'eticket');
69
70
        // Register the main class to use with the facade
71
        $this->app->singleton('eticket', function () {
72
            return new Eticket;
73
        });
74
    }
75
}
76