1 | <?php |
||
10 | class TerminalServiceProvider extends ServiceProvider |
||
11 | { |
||
12 | /** |
||
13 | * namespace. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $namespace = 'Recca0120\Terminal\Http\Controllers'; |
||
18 | |||
19 | /** |
||
20 | * Bootstrap any application services. |
||
21 | * |
||
22 | * @param Request $request |
||
23 | * @param Router $router |
||
24 | */ |
||
25 | 1 | public function boot(Request $request, Router $router) |
|
26 | { |
||
27 | 1 | $config = $this->app['config']['terminal']; |
|
28 | 1 | if ($this->allowWhiteList($request, $config)) { |
|
29 | 1 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'terminal'); |
|
30 | 1 | $this->handleRoutes($router, $config); |
|
31 | } |
||
32 | |||
33 | 1 | if ($this->app->runningInConsole() === true) { |
|
34 | 1 | $this->handlePublishes(); |
|
35 | } |
||
36 | 1 | } |
|
37 | |||
38 | /** |
||
39 | * Register any application services. |
||
40 | */ |
||
41 | 1 | public function register() |
|
63 | |||
64 | /** |
||
65 | * register routes. |
||
66 | * |
||
67 | * @param Router $router |
||
68 | * @param array $config |
||
69 | */ |
||
70 | 1 | protected function handleRoutes(Router $router, $config = []) |
|
80 | |||
81 | /** |
||
82 | * handle publishes. |
||
83 | */ |
||
84 | 1 | protected function handlePublishes() |
|
92 | |||
93 | /** |
||
94 | * @param Request $request |
||
95 | * @param $config |
||
96 | * @return bool |
||
97 | */ |
||
98 | private function allowWhiteList(Request $request, $config) |
||
106 | } |
||
107 |