/
Service.php
65 lines (54 loc) · 1.35 KB
/
Service.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* plus-admin
*
* @author Panlatent<panlatent@gmail.com>
* @license http://opensource.org/licenses/MIT
*/
namespace PlusAdmin;
use PlusAdmin\Module\ModuleManager;
use PlusAdmin\Plugin\PluginManager;
class Service extends Support\Service {
/**
* @var \PlusAdmin\Module\ModuleManager
*/
protected $moduleManager;
/**
* @var \PlusAdmin\Plugin\PluginManager
*/
protected $pluginManager;
/**
*
*/
protected function register()
{
$this->moduleManager= new ModuleManager($this->app);
$this->pluginManager = new PluginManager($this->app);
}
/**
*
*/
public function boot()
{
event('plus-admin.module.setup:before', [$this, $this->moduleManager]);
$this->moduleManager->setup();
event('plus-admin.module.setup:after', [$this, $this->moduleManager]);
event('plus-admin.plugin.setup:before', [$this, $this->pluginManager]);
$this->pluginManager->setup();
event('plus-admin.plugin.setup:after', [$this, $this->pluginManager]);
}
/**
* @return \PlusAdmin\Module\ModuleManager
*/
public function module()
{
return $this->moduleManager;
}
/**
* @return \PlusAdmin\Plugin\PluginManager
*/
public function plugin()
{
return $this->pluginManager;
}
}