3
3
namespace Zonneplan \ModuleLoader ;
4
4
5
5
use Illuminate \Console \Scheduling \Schedule ;
6
- use Illuminate \Database \Eloquent \Factory ;
7
6
use Illuminate \Routing \Router ;
8
7
use Illuminate \Support \Facades \Event ;
9
8
use Illuminate \Support \Facades \Gate ;
22
21
abstract class Module extends ServiceProvider implements ModuleContract
23
22
{
24
23
protected const ROUTE_FILE_TYPES = [
25
- 'routes ' , 'web ' , 'api ' ,
24
+ 'routes ' ,
25
+ 'web ' ,
26
+ 'api ' ,
26
27
];
27
28
28
- /** @var array */
29
- protected $ policies = [];
29
+ protected array $ policies = [];
30
30
31
- /** @var array */
32
- protected $ middleware = [];
31
+ protected array $ middleware = [];
33
32
34
- /** @var array */
35
- protected $ listen = [];
33
+ protected array $ listen = [];
36
34
37
- /** @var array */
38
- protected $ subscribe = [];
35
+ protected array $ subscribe = [];
39
36
40
- /** @var string */
41
- protected $ modulePath ;
37
+ protected string $ modulePath ;
42
38
43
39
/**
44
40
* Register the module.
45
41
*
46
- * @throws ReflectionException
47
- *
48
42
* @return void
49
43
*/
50
44
public function register (): void
@@ -56,9 +50,8 @@ public function register(): void
56
50
/**
57
51
* Boot the module.
58
52
*
59
- * @throws ReflectionException
60
- *
61
53
* @return void
54
+ * @throws ReflectionException
62
55
*/
63
56
public function boot (): void
64
57
{
@@ -91,8 +84,6 @@ protected function loadCommandSchedule(): void
91
84
}
92
85
93
86
/**
94
- * @throws ReflectionException
95
- *
96
87
* @return void
97
88
*/
98
89
protected function loadMigrations (): void
@@ -105,8 +96,6 @@ protected function loadMigrations(): void
105
96
}
106
97
107
98
/**
108
- * @throws ReflectionException
109
- *
110
99
* @return void
111
100
*/
112
101
protected function loadViews (): void
@@ -119,8 +108,6 @@ protected function loadViews(): void
119
108
}
120
109
121
110
/**
122
- * @throws ReflectionException
123
- *
124
111
* @return void
125
112
*/
126
113
protected function loadTranslations (): void
@@ -133,8 +120,6 @@ protected function loadTranslations(): void
133
120
}
134
121
135
122
/**
136
- * @throws ReflectionException
137
- *
138
123
* @return void
139
124
*/
140
125
protected function loadConfigs (): void
@@ -180,8 +165,6 @@ protected function registerListeners(): void
180
165
}
181
166
182
167
/**
183
- * @throws ReflectionException
184
- *
185
168
* @return string
186
169
*/
187
170
protected function getModulePath (): string
@@ -246,9 +229,8 @@ private function registerMiddleware(): void
246
229
*/
247
230
private function registerFactories (): void
248
231
{
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.
252
234
}
253
235
254
236
private function registerRoutes (): void
0 commit comments