1 | <?php |
||
17 | class EventsServiceProvider extends ServiceProvider |
||
18 | { |
||
19 | |||
20 | public function register() |
||
21 | { |
||
22 | if (!defined('EVENTS_PATH')) { |
||
23 | define('EVENTS_PATH', realpath(__DIR__.'/../../')); |
||
24 | } |
||
25 | |||
26 | $this->registerEloquentFactoriesFrom(EVENTS_PATH . '/database/factories'); |
||
27 | |||
28 | } |
||
29 | |||
30 | public function boot() |
||
31 | { |
||
32 | |||
33 | $this->defineRoutes(); |
||
34 | $this->loadViews(); |
||
35 | $this->loadmigrations(); |
||
36 | $this->loadCommands(); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Load commands |
||
41 | */ |
||
42 | protected function loadCommands() |
||
54 | |||
55 | private function defineRoutes() |
||
56 | { |
||
57 | $this->defineWebRoutes(); |
||
58 | $this->defineApiRoutes(); |
||
59 | } |
||
60 | |||
61 | protected function defineWebRoutes() { |
||
62 | require EVENTS_PATH . '/routes/web.php'; |
||
63 | } |
||
64 | |||
65 | protected function defineApiRoutes() { |
||
68 | |||
69 | private function loadViews() |
||
73 | |||
74 | private function loadMigrations() |
||
78 | |||
79 | /** |
||
80 | * Register factories. |
||
81 | * |
||
82 | * @param string $path |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function registerEloquentFactoriesFrom($path) |
||
89 | } |