UserCommandsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 12
rs 9.9666
1
<?php
2
3
namespace Luilliarcec\UserCommands;
4
5
use Illuminate\Support\ServiceProvider;
6
use Luilliarcec\UserCommands\Commands\CreateNewUserCommand;
7
use Luilliarcec\UserCommands\Commands\DeleteUserCommand;
8
use Luilliarcec\UserCommands\Commands\ResetUserPasswordCommand;
9
use Luilliarcec\UserCommands\Commands\RestoreUserCommand;
10
11
class UserCommandsServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Bootstrap the application services.
15
     */
16
    public function boot()
17
    {
18
        if ($this->app->runningInConsole()) {
19
            $this->publishes([
20
                __DIR__ . '/../config/config.php' => config_path('user-commands.php'),
21
            ], 'config');
22
23
            $this->commands([
24
                CreateNewUserCommand::class,
25
                ResetUserPasswordCommand::class,
26
                DeleteUserCommand::class,
27
                RestoreUserCommand::class,
28
            ]);
29
        }
30
    }
31
32
    /**
33
     * Register the application services.
34
     */
35
    public function register()
36
    {
37
        // Automatically apply the package configuration
38
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'user-commands');
39
    }
40
}
41