1 | <?php |
||
9 | class BaseServiceProvider extends ServiceProvider |
||
10 | { |
||
11 | protected $commands = [ |
||
12 | \Backpack\Base\app\Console\Commands\Install::class, |
||
13 | \Backpack\Base\app\Console\Commands\AddSidebarContent::class, |
||
14 | \Backpack\Base\app\Console\Commands\AddCustomRouteContent::class, |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * Indicates if loading of the provider is deferred. |
||
19 | * |
||
20 | * @var bool |
||
21 | */ |
||
22 | protected $defer = false; |
||
23 | |||
24 | /** |
||
25 | * Where the route file lives, both inside the package and in the app (if overwritten). |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | public $routeFilePath = '/routes/backpack/base.php'; |
||
30 | |||
31 | /** |
||
32 | * Where custom routes can be written, and will be registered by Backpack. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | public $customRoutesFilePath = '/routes/backpack/custom.php'; |
||
37 | |||
38 | /** |
||
39 | * Perform post-registration booting of services. |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function boot(\Illuminate\Routing\Router $router) |
||
70 | |||
71 | /** |
||
72 | * Load the Backpack helper methods, for convenience. |
||
73 | */ |
||
74 | public function loadHelpers() |
||
78 | |||
79 | /** |
||
80 | * Define the routes for the application. |
||
81 | * |
||
82 | * @param \Illuminate\Routing\Router $router |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | public function setupRoutes(Router $router) |
||
98 | |||
99 | /** |
||
100 | * Load custom routes file. |
||
101 | * |
||
102 | * @param \Illuminate\Routing\Router $router |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | public function setupCustomRoutes(Router $router) |
||
113 | |||
114 | /** |
||
115 | * Register any package services. |
||
116 | * |
||
117 | * @return void |
||
118 | */ |
||
119 | public function register() |
||
152 | |||
153 | public function registerMiddlewareGroup(Router $router) |
||
168 | |||
169 | public function publishFiles() |
||
170 | { |
||
171 | $error_views = [__DIR__.'/resources/error_views' => resource_path('views/errors')]; |
||
172 | $backpack_base_views = [__DIR__.'/resources/views' => resource_path('views/vendor/backpack/base')]; |
||
173 | $backpack_public_assets = [__DIR__.'/public' => public_path('vendor/backpack')]; |
||
174 | $backpack_lang_files = [__DIR__.'/resources/lang' => resource_path('lang/vendor/backpack')]; |
||
175 | $backpack_config_files = [__DIR__.'/config' => config_path()]; |
||
176 | |||
177 | // sidebar_content view, which is the only view most people need to overwrite |
||
178 | $backpack_sidebar_contents_view = [__DIR__.'/resources/views/inc/sidebar_content.blade.php' => resource_path('views/vendor/backpack/base/inc/sidebar_content.blade.php')]; |
||
179 | $backpack_custom_routes_file = [__DIR__.$this->customRoutesFilePath => base_path($this->customRoutesFilePath)]; |
||
180 | |||
181 | // calculate the path from current directory to get the vendor path |
||
182 | $vendorPath = dirname(__DIR__, 3); |
||
183 | $adminlte_assets = [$vendorPath.'/almasaeed2010/adminlte' => public_path('vendor/adminlte')]; |
||
184 | $gravatar_assets = [$vendorPath.'/creativeorange/gravatar/config' => config_path()]; |
||
185 | |||
186 | // establish the minimum amount of files that need to be published, for Backpack to work; there are the files that will be published by the install command |
||
187 | $minimum = array_merge( |
||
188 | $error_views, |
||
189 | // $backpack_base_views, |
||
190 | $backpack_public_assets, |
||
191 | // $backpack_lang_files, |
||
192 | $backpack_config_files, |
||
193 | $backpack_sidebar_contents_view, |
||
194 | $backpack_custom_routes_file, |
||
195 | $adminlte_assets, |
||
196 | $gravatar_assets |
||
197 | ); |
||
198 | |||
199 | // register all possible publish commands and assign tags to each |
||
200 | $this->publishes($backpack_config_files, 'config'); |
||
201 | $this->publishes($backpack_lang_files, 'lang'); |
||
202 | $this->publishes($backpack_base_views, 'views'); |
||
203 | $this->publishes($backpack_sidebar_contents_view, 'sidebar_content'); |
||
204 | $this->publishes($error_views, 'errors'); |
||
205 | $this->publishes($backpack_public_assets, 'public'); |
||
206 | $this->publishes($backpack_custom_routes_file, 'custom_routes'); |
||
207 | $this->publishes($adminlte_assets, 'adminlte'); |
||
208 | $this->publishes($gravatar_assets, 'gravatar'); |
||
209 | $this->publishes($minimum, 'minimum'); |
||
210 | } |
||
211 | |||
212 | /** |
||
213 | * Check to to see if a license code exists. |
||
214 | * If it does not, throw a notification bubble. |
||
215 | * |
||
216 | * @return void |
||
217 | */ |
||
218 | private function checkLicenseCodeExists() |
||
224 | } |
||
225 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.