EmailConfirmationServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 0
dl 0
loc 21
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
namespace BeyondCode\EmailConfirmation;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class EmailConfirmationServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        if ($this->app->runningInConsole()) {
15
            $this->publishes([
16
                __DIR__.'/../config/config.php' => config_path('confirmation.php'),
17
            ], 'config');
18
19
            if (! class_exists('AddConfirmationFieldsToUsers')) {
20
                $this->publishes([
21
                    __DIR__.'/../database/migrations/add_confirmation_fields_to_users.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_add_confirmation_fields_to_users.php'),
22
                ], 'migrations');
23
            }
24
25
            $this->publishes([
26
                __DIR__.'/../resources/lang' => resource_path('lang/vendor/confirmation'),
27
            ]);
28
29
        }
30
31
        $this->loadTranslationsFrom(__DIR__.'/../resources/lang/', 'confirmation');
32
    }
33
34
    /**
35
     * Register the application services.
36
     */
37
    public function register()
38
    {
39
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'confirmation');
40
    }
41
}
42