| 1 | <?php |
||
| 8 | class AppsServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Bootstrap the service provider. |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | 2 | public function boot() |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Register macros for UrlGenerator. |
||
| 26 | * |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | 2 | protected function macroUrlGenerator() |
|
| 30 | { |
||
| 31 | $this->app['url']->macro('getRootControllerNamespace', function () { |
||
| 32 | 1 | return $this->rootNamespace; |
|
|
|
|||
| 33 | 2 | }); |
|
| 34 | 2 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Publish assets from package. |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | 2 | protected function publishAssets() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Register the service provider. |
||
| 50 | * |
||
| 51 | * @return void |
||
| 52 | */ |
||
| 53 | 2 | public function register() |
|
| 62 | |||
| 63 | /** |
||
| 64 | * Setup package assets. |
||
| 65 | * |
||
| 66 | * @return void |
||
| 67 | */ |
||
| 68 | 2 | protected function setupAssets() |
|
| 76 | } |
||
| 77 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: