AdminServiceProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A register() 0 3 1
1
<?php
2
3
namespace Epesi\Core\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Epesi\Core\Console\DatabaseCreateCommand;
7
use Epesi\Core\Console\EpesiCommand;
8
use Epesi\Core\Console\SetEnvCommand;
9
use Epesi\Core\Console\DatabaseConnectionCommand;
10
use Epesi\Core\System\Modules\ModuleManager;
11
use Epesi\Core\Console\ModuleInstallCommand;
12
13
class AdminServiceProvider extends ServiceProvider
14
{
15
	protected $commands = [
16
			EpesiCommand::class,
17
			DatabaseCreateCommand::class,
18
			DatabaseConnectionCommand::class,
19
			SetEnvCommand::class,
20
			ModuleInstallCommand::class
21
	];
22
	
23
    /**
24
     * Booting the package.
25
     */
26
    public function boot()
27
    {
28
    	$this->app->register(\JoeDixon\Translation\TranslationServiceProvider::class);
29
    	
30
    	// Register migrations from installed modules
31
    	$this->loadMigrationsFrom(ModuleManager::collect('migrations'));
32
33
    	// Publish epesi configuration files
34
    	$this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config');
35
    }
36
37
    /**
38
     * Register the provider.
39
     */
40
    public function register()
41
    {
42
    	$this->commands($this->commands);
43
    }
44
}
45