AddressesServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 10
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 15
rs 9.9332
1
<?php
2
3
namespace Signifly\Addresses;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class AddressesServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->publishes([
17
            __DIR__.'/../config/addresses.php' => config_path('addresses.php'),
18
        ], 'config');
19
20
        $this->mergeConfigFrom(__DIR__.'/../config/addresses.php', 'addresses');
21
22
        if (! class_exists('CreateAddressesTable')) {
23
            $timestamp = date('Y_m_d_His', time());
24
            $table = config('addresses.table_name');
25
26
            $this->publishes([
27
                __DIR__.'/../migrations/create_addresses_table.php.stub' => database_path("/migrations/{$timestamp}_create_{$table}_table.php"),
28
            ], 'migrations');
29
        }
30
    }
31
32
    /**
33
     * Register the service provider.
34
     *
35
     * @return void
36
     */
37
    public function register()
38
    {
39
    }
40
}
41