File tree 6 files changed +22
-12
lines changed
6 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ composer.lock
6
6
phpunit.xml
7
7
.env
8
8
.idea
9
- .phpunit.result.cache
9
+ .phpunit.result.cache
10
+ .DS_Store
Original file line number Diff line number Diff line change 5
5
[ ![ Build Status] ( https://img.shields.io/travis/zonneplan/laravel-module-loader/master.svg?style=flat-square )] ( https://travis-ci.org/zonneplan/laravel-module-loader )
6
6
[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/zonneplan/laravel-module-loader.svg?style=flat-square )] ( https://packagist.org/packages/zonneplan/laravel-module-loader )
7
7
8
+ | ** Laravel** | ** laravel-module-loader** |
9
+ | ---| ---------------------------|
10
+ | 5.8 | ^1.0 |
11
+ | 6.0 | ^1.0 |
12
+ | 7.0 | ^1.0 |
13
+ | 8.0 | ^2.0 |
14
+ | 9.0 | ^3.0 |
15
+
8
16
The ` zonneplan/laravel-module-loader ` package provides an easy to use module loader
9
17
which can be used to modulize your project.
10
18
Original file line number Diff line number Diff line change 12
12
"license" : " MIT" ,
13
13
"authors" : [],
14
14
"require" : {
15
- "php" : " ^7.4|^ 8.0" ,
16
- "illuminate/console" : " ^8 .0" ,
17
- "illuminate/database" : " ^8 .0" ,
18
- "illuminate/support" : " ^8 .0" ,
19
- "illuminate/routing" : " ^8 .0"
15
+ "php" : " ^8.0" ,
16
+ "illuminate/console" : " ^9 .0" ,
17
+ "illuminate/database" : " ^9 .0" ,
18
+ "illuminate/support" : " ^9 .0" ,
19
+ "illuminate/routing" : " ^9 .0"
20
20
},
21
21
"require-dev" : {
22
22
"phpunit/phpunit" : " ^9.5" ,
23
23
"mockery/mockery" : " ^1.4" ,
24
- "orchestra/testbench" : " ^6 .0"
24
+ "orchestra/testbench" : " ^7 .0"
25
25
},
26
26
"autoload" : {
27
27
"psr-4" : {
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ abstract class Module extends ServiceProvider implements ModuleContract
36
36
37
37
protected ?string $ modulePath = null ;
38
38
39
+ protected bool $ enableLegacyFactoryLoading = false ;
40
+
39
41
/**
40
42
* Register the module.
41
43
*
@@ -230,6 +232,7 @@ private function registerMiddleware(): void
230
232
private function registerFactories (): void
231
233
{
232
234
if (
235
+ $ this ->enableLegacyFactoryLoading &&
233
236
method_exists ($ this , 'loadFactoriesFrom ' ) &&
234
237
file_exists ($ this ->getModulePath ().'/Database/Factories ' )
235
238
) {
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ class ModulesServiceProvider extends ServiceProvider
17
17
*/
18
18
public function register (): void
19
19
{
20
- $ this ->app ->singleton (ModuleRepositoryContract::class, static function () {
21
- return new ModuleRepository ();
22
- });
20
+ $ this ->app ->singleton (ModuleRepositoryContract::class, ModuleRepository::class);
23
21
}
24
22
25
23
/**
Original file line number Diff line number Diff line change 4
4
5
5
use Zonneplan \ModuleLoader \Support \Contracts \ModuleRepositoryContract ;
6
6
use Zonneplan \ModuleLoader \Support \Exceptions \ModuleNotFoundException ;
7
+ use Zonneplan \ModuleLoader \Support \ModuleRepository ;
7
8
use Zonneplan \ModuleLoader \Test \TestCase ;
8
9
9
10
class ModuleRepositoryTest extends TestCase
10
11
{
11
- /* @var ModuleRepository */
12
- protected $ moduleRepository ;
12
+ protected ModuleRepository $ moduleRepository ;
13
13
14
14
public function setUp (): void
15
15
{
You can’t perform that action at this time.
0 commit comments