1
|
|
|
<?php namespace Bantenprov\DashboardEpormas; |
2
|
|
|
|
3
|
|
|
use Illuminate\Support\ServiceProvider; |
4
|
|
|
use Bantenprov\DashboardEpormas\Console\Commands\EpormasCommand; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* The EpormasServiceProvider class |
8
|
|
|
* |
9
|
|
|
* @package Bantenprov\DashboardEpormas |
10
|
|
|
* @author Esza Herdi <[email protected]> |
11
|
|
|
*/ |
12
|
|
|
class EpormasServiceProvider extends ServiceProvider |
13
|
|
|
{ |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Indicates if loading of the provider is deferred. |
17
|
|
|
* |
18
|
|
|
* @var bool |
19
|
|
|
*/ |
20
|
|
|
protected $defer = false; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Bootstrap the application events. |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
public function boot() |
28
|
|
|
{ |
29
|
|
|
// Bootstrap handles |
30
|
|
|
$this->routeHandle(); |
31
|
|
|
$this->configHandle(); |
32
|
|
|
$this->langHandle(); |
33
|
|
|
$this->viewHandle(); |
34
|
|
|
$this->migrationHandle(); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Register the service provider. |
39
|
|
|
* |
40
|
|
|
* @return void |
41
|
|
|
*/ |
42
|
|
|
public function register() |
43
|
|
|
{ |
44
|
|
|
$this->app->singleton('epormas', function ($app) { |
|
|
|
|
45
|
|
|
return new Epormas; |
46
|
|
|
}); |
47
|
|
|
|
48
|
|
|
$this->app->singleton('command.epormas', function ($app) { |
|
|
|
|
49
|
|
|
return new EpormasCommand; |
50
|
|
|
}); |
51
|
|
|
|
52
|
|
|
$this->commands('command.epormas'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get the services provided by the provider. |
57
|
|
|
* |
58
|
|
|
* @return array |
59
|
|
|
*/ |
60
|
|
|
public function provides() |
61
|
|
|
{ |
62
|
|
|
return [ |
63
|
|
|
'epormas', |
64
|
|
|
'command.epormas', |
65
|
|
|
]; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
protected function routeHandle() |
69
|
|
|
{ |
70
|
|
|
$this->loadRoutesFrom(__DIR__.'/routes/routes.php'); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
protected function configHandle() |
74
|
|
|
{ |
75
|
|
|
$packageConfigPath = __DIR__.'/config/config.php'; |
76
|
|
|
$appConfigPath = config_path('epormas.php'); |
|
|
|
|
77
|
|
|
|
78
|
|
|
$this->mergeConfigFrom($packageConfigPath, 'epormas'); |
79
|
|
|
|
80
|
|
|
$this->publishes([ |
81
|
|
|
$packageConfigPath => $appConfigPath, |
82
|
|
|
], 'config'); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
protected function langHandle() |
86
|
|
|
{ |
87
|
|
|
$packageTranslationsPath = __DIR__.'/resources/lang'; |
88
|
|
|
|
89
|
|
|
$this->loadTranslationsFrom($packageTranslationsPath, 'epormas'); |
90
|
|
|
|
91
|
|
|
$this->publishes([ |
92
|
|
|
$packageTranslationsPath => resource_path('lang/vendor/epormas'), |
|
|
|
|
93
|
|
|
], 'lang'); |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
protected function viewHandle() |
97
|
|
|
{ |
98
|
|
|
$packageViewsPath = __DIR__.'/resources/assets/components'; |
99
|
|
|
$this->publishes([ |
100
|
|
|
$packageViewsPath => resource_path('assets/components'), |
|
|
|
|
101
|
|
|
], 'views'); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
protected function migrationHandle() |
105
|
|
|
{ |
106
|
|
|
$packageMigrationsPath = __DIR__.'/database/migrations'; |
107
|
|
|
$this->publishes([ |
108
|
|
|
$packageMigrationsPath => database_path('migrations') |
|
|
|
|
109
|
|
|
], 'migrations'); |
110
|
|
|
} |
111
|
|
|
} |
112
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.