BangladeshGeocodeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 9.536
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Devfaysal\BangladeshGeocode;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class BangladeshGeocodeServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        /*
15
         * Optional methods to load your package assets
16
         */
17
18
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
19
20
        if ($this->app->runningInConsole()) {
21
            // $this->publishes([
22
            //     __DIR__.'/../config/config.php' => config_path('bangladesh-geocode.php'),
23
            // ], 'config');
24
25
            $this->publishes([
26
                __DIR__.'/../database/migrations' => database_path('migrations'),
27
            ], 'bangladesh-geocode-migrations');
28
            $this->publishes([
29
                __DIR__.'/../database/seeders' => database_path('seeders'),
30
            ], 'bangladesh-geocode-seeders');
31
32
            // Registering package commands.
33
            // $this->commands([]);
34
        }
35
    }
36
37
    /**
38
     * Register the application services.
39
     */
40
    public function register()
41
    {
42
        // Automatically apply the package configuration
43
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'bangladesh-geocode');
44
45
        // Register the main class to use with the facade
46
        $this->app->singleton('bangladesh-geocode', function () {
47
            return new BangladeshGeocode;
48
        });
49
    }
50
}
51