33namespace Zonneplan \ModuleLoader ;
44
55use Illuminate \Console \Scheduling \Schedule ;
6- use Illuminate \Database \Eloquent \Factory ;
76use Illuminate \Routing \Router ;
87use Illuminate \Support \Facades \Event ;
98use Illuminate \Support \Facades \Gate ;
2221abstract class Module extends ServiceProvider implements ModuleContract
2322{
2423 protected const ROUTE_FILE_TYPES = [
25- 'routes ' , 'web ' , 'api ' ,
24+ 'routes ' ,
25+ 'web ' ,
26+ 'api ' ,
2627 ];
2728
28- /** @var array */
29- protected $ policies = [];
29+ protected array $ policies = [];
3030
31- /** @var array */
32- protected $ middleware = [];
31+ protected array $ middleware = [];
3332
34- /** @var array */
35- protected $ listen = [];
33+ protected array $ listen = [];
3634
37- /** @var array */
38- protected $ subscribe = [];
35+ protected array $ subscribe = [];
3936
40- /** @var string */
41- protected $ modulePath ;
37+ protected string $ modulePath ;
4238
4339 /**
4440 * Register the module.
4541 *
46- * @throws ReflectionException
47- *
4842 * @return void
4943 */
5044 public function register (): void
@@ -56,9 +50,8 @@ public function register(): void
5650 /**
5751 * Boot the module.
5852 *
59- * @throws ReflectionException
60- *
6153 * @return void
54+ * @throws ReflectionException
6255 */
6356 public function boot (): void
6457 {
@@ -91,8 +84,6 @@ protected function loadCommandSchedule(): void
9184 }
9285
9386 /**
94- * @throws ReflectionException
95- *
9687 * @return void
9788 */
9889 protected function loadMigrations (): void
@@ -105,8 +96,6 @@ protected function loadMigrations(): void
10596 }
10697
10798 /**
108- * @throws ReflectionException
109- *
11099 * @return void
111100 */
112101 protected function loadViews (): void
@@ -119,8 +108,6 @@ protected function loadViews(): void
119108 }
120109
121110 /**
122- * @throws ReflectionException
123- *
124111 * @return void
125112 */
126113 protected function loadTranslations (): void
@@ -133,8 +120,6 @@ protected function loadTranslations(): void
133120 }
134121
135122 /**
136- * @throws ReflectionException
137- *
138123 * @return void
139124 */
140125 protected function loadConfigs (): void
@@ -180,8 +165,6 @@ protected function registerListeners(): void
180165 }
181166
182167 /**
183- * @throws ReflectionException
184- *
185168 * @return string
186169 */
187170 protected function getModulePath (): string
@@ -246,9 +229,8 @@ private function registerMiddleware(): void
246229 */
247230 private function registerFactories (): void
248231 {
249- $ this ->app ->afterResolving (Factory::class, function (Factory $ faker ) {
250- $ faker ->load ($ this ->getModulePath ().'/Database/Factories ' );
251- });
232+ // Unfortunately Laravel 8 no longer supports loading factories like this
233+ // because they want you to use ModelFactories.
252234 }
253235
254236 private function registerRoutes (): void
0 commit comments