LaravelServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Koomai\LaravelConfig\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Koomai\LaravelConfig\Console\Commands\AddDatabaseConfigCommand;
7
use Koomai\LaravelConfig\Console\Commands\DeleteDatabaseConfigCommand;
8
9
class LaravelServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14 7
    public function boot()
15
    {
16 7
        $this->publishes([
17 7
            __DIR__.'/../../config/database-config.php' => config_path('database-config.php'),
18 7
        ], 'config');
19
20 7
        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
21
22 7
        if ($this->app->runningInConsole()) {
23 7
            $this->commands([
24 7
                AddDatabaseConfigCommand::class,
25
                DeleteDatabaseConfigCommand::class,
26
            ]);
27
        }
28 7
    }
29
30
    /**
31
     * Register the service provider.
32
     *
33
     * @return void
34
     */
35 7
    public function register()
36
    {
37 7
        $this->mergeConfigFrom(__DIR__.'/../../config/database-config.php', 'database-config');
38 7
    }
39
}
40