1 | <?php |
||
14 | class ServiceProvider extends BaseServiceProvider |
||
15 | { |
||
16 | /** |
||
17 | * @var Router |
||
18 | */ |
||
19 | protected $router; |
||
20 | |||
21 | /** |
||
22 | * Create a new service provider instance. |
||
23 | * |
||
24 | * @param Application $app |
||
25 | */ |
||
26 | public function __construct(Application $app) |
||
30 | |||
31 | /** |
||
32 | * Bootstrap the application services. |
||
33 | * |
||
34 | * @param Router $router |
||
35 | * @return void |
||
36 | */ |
||
37 | public function boot(Router $router) |
||
46 | |||
47 | /** |
||
48 | * Register the application services. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | public function register() |
||
56 | |||
57 | /** |
||
58 | * @return void |
||
59 | */ |
||
60 | protected function publishConfigs() |
||
66 | |||
67 | /** |
||
68 | * @return void |
||
69 | */ |
||
70 | protected function publishMigrations() |
||
81 | |||
82 | /** |
||
83 | * @return void |
||
84 | */ |
||
85 | protected function registerMiddleware() |
||
89 | |||
90 | /** |
||
91 | * @return void |
||
92 | */ |
||
93 | protected function registerRouteBindings() |
||
97 | |||
98 | /** |
||
99 | * @return void |
||
100 | */ |
||
101 | protected function registerBindings() |
||
106 | } |
||
107 |
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: