1 | <?php namespace Mascame\Artificer; |
||
17 | class ArtificerServiceProvider extends ServiceProvider { |
||
18 | |||
19 | use AutoPublishable, ServiceProviderLoader; |
||
20 | |||
21 | protected $name = 'admin'; |
||
22 | |||
23 | protected $corePlugins = [ |
||
24 | \Mascame\Artificer\LoginPlugin::class |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * Indicates if loading of the provider is deferred. |
||
29 | * |
||
30 | * @var bool |
||
31 | */ |
||
32 | protected $defer = false; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $isBootable = false; |
||
38 | |||
39 | /** |
||
40 | * Bootstrap the application events. |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function boot() |
||
45 | { |
||
46 | if (! $this->isBootable) return; |
||
47 | |||
48 | $this->addPublishableFiles(); |
||
49 | |||
50 | // Wait until app is ready for config to be published |
||
51 | if (! $this->isPublished()) return; |
||
52 | |||
53 | $this->providers(config('admin.providers')); |
||
54 | $this->aliases(config('admin.aliases')); |
||
55 | $this->commands(config('admin.commands')); |
||
56 | |||
57 | Artificer::pluginManager()->boot(); |
||
58 | Artificer::widgetManager()->boot(); |
||
59 | |||
60 | $this->manageCorePlugins(); |
||
61 | |||
62 | Artificer::assetManager()->add(config('admin.assets', [])); |
||
63 | |||
64 | $this->requireFiles(); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Ensure core plugins are installed |
||
69 | * |
||
70 | * @throws \Exception |
||
71 | */ |
||
72 | protected function manageCorePlugins() { |
||
104 | |||
105 | /** |
||
106 | * Determines if is on admin |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function isBootable($path, $routePrefix = null) { |
||
117 | |||
118 | private function requireFiles() |
||
122 | |||
123 | protected function getConfigPath() { |
||
126 | |||
127 | private function addPublishableFiles() |
||
139 | |||
140 | private function addLocalization() |
||
146 | |||
147 | private function getExtensionInstaller($type) { |
||
154 | |||
155 | private function addManagers() |
||
185 | |||
186 | /** |
||
187 | * Register the service provider. |
||
188 | * |
||
189 | * @return void |
||
190 | */ |
||
191 | public function register() |
||
210 | |||
211 | /** |
||
212 | * Moves admin/admin.php keys to the root level for commodity |
||
213 | */ |
||
214 | protected function loadConfig() { |
||
221 | |||
222 | /** |
||
223 | * Get the services provided by the provider. |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function provides() |
||
231 | |||
232 | } |
||
233 |