LaravelServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 29
ccs 11
cts 11
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 2
A register() 0 3 1
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