OtpServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Alish\LaravelOtp;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class OtpServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the application services.
11
     */
12
    public function boot()
13
    {
14
        $this->publishes([
15
            __DIR__.'/../migrations/' => database_path('migrations')
16
        ], 'migrations');
17
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__.'/../config/config.php' => config_path('otp.php'),
21
            ], 'config');
22
23
            // Registering package commands.
24
            // $this->commands([]);
25
        }
26
    }
27
28
    /**
29
     * Register the application services.
30
     */
31
    public function register()
32
    {
33
        // Automatically apply the package configuration
34
        $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'otp');
35
36
        // Register the main class to use with the facade
37
        $this->app->singleton('otp', function ($app) {
38
            return new OtpManager($app);
39
        });
40
    }
41
}
42