1 | <?php |
||
8 | class ThemesServiceProvider extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Register any application services. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function register() |
||
21 | |||
22 | /** |
||
23 | * Perform post-registration booting of services. |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public function boot() |
||
28 | { |
||
29 | $this->publishes([ |
||
30 | __DIR__.'/../config/themes.php' => config_path('themes.php'), |
||
31 | ]); |
||
32 | |||
33 | $this->app['themes']->setTheme($this->app['request']); |
||
34 | |||
35 | $this->mapWebRoutes(); |
||
36 | |||
37 | $this->mapApiRoutes(); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Re-register the view finder to use use local copy. |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | protected function registerViewFinder() |
||
56 | |||
57 | /** |
||
58 | * Register the themes service. |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | protected function registerThemes() |
||
63 | { |
||
64 | $this->app->singleton('themes', function() { |
||
65 | return new Themes; |
||
66 | }); |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Define the "web" routes for the theme. |
||
71 | * |
||
72 | * These routes all receive session state, CSRF protection, etc. |
||
73 | * |
||
74 | * @return void |
||
75 | */ |
||
76 | protected function mapWebRoutes() |
||
85 | |||
86 | /** |
||
87 | * Define the "api" routes for the theme. Routes are in two groups, those requiring |
||
88 | * a user to be authenticated and another for routes that don't require any authentication. |
||
89 | * |
||
90 | * These routes are typically stateless. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | protected function mapApiRoutes() |
||
112 | |||
113 | /** |
||
114 | * Load route file, but only after checking whether it exists in the theme. |
||
115 | * |
||
116 | * @return void |
||
117 | */ |
||
118 | protected function loadRouteFile($routeFile) |
||
125 | } |
||
126 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.