File tree Expand file tree Collapse file tree 6 files changed +22
-12
lines changed
Expand file tree Collapse file tree 6 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ composer.lock
66phpunit.xml
77.env
88.idea
9- .phpunit.result.cache
9+ .phpunit.result.cache
10+ .DS_Store
Original file line number Diff line number Diff line change 55[ ![ Build Status] ( https://img.shields.io/travis/zonneplan/laravel-module-loader/master.svg?style=flat-square )] ( https://travis-ci.org/zonneplan/laravel-module-loader )
66[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/zonneplan/laravel-module-loader.svg?style=flat-square )] ( https://packagist.org/packages/zonneplan/laravel-module-loader )
77
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+
816The ` zonneplan/laravel-module-loader ` package provides an easy to use module loader
917which can be used to modulize your project.
1018
Original file line number Diff line number Diff line change 1212 "license" : " MIT" ,
1313 "authors" : [],
1414 "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"
2020 },
2121 "require-dev" : {
2222 "phpunit/phpunit" : " ^9.5" ,
2323 "mockery/mockery" : " ^1.4" ,
24- "orchestra/testbench" : " ^6 .0"
24+ "orchestra/testbench" : " ^7 .0"
2525 },
2626 "autoload" : {
2727 "psr-4" : {
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ abstract class Module extends ServiceProvider implements ModuleContract
3636
3737 protected ?string $ modulePath = null ;
3838
39+ protected bool $ enableLegacyFactoryLoading = false ;
40+
3941 /**
4042 * Register the module.
4143 *
@@ -230,6 +232,7 @@ private function registerMiddleware(): void
230232 private function registerFactories (): void
231233 {
232234 if (
235+ $ this ->enableLegacyFactoryLoading &&
233236 method_exists ($ this , 'loadFactoriesFrom ' ) &&
234237 file_exists ($ this ->getModulePath ().'/Database/Factories ' )
235238 ) {
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ class ModulesServiceProvider extends ServiceProvider
1717 */
1818 public function register (): void
1919 {
20- $ this ->app ->singleton (ModuleRepositoryContract::class, static function () {
21- return new ModuleRepository ();
22- });
20+ $ this ->app ->singleton (ModuleRepositoryContract::class, ModuleRepository::class);
2321 }
2422
2523 /**
Original file line number Diff line number Diff line change 44
55use Zonneplan \ModuleLoader \Support \Contracts \ModuleRepositoryContract ;
66use Zonneplan \ModuleLoader \Support \Exceptions \ModuleNotFoundException ;
7+ use Zonneplan \ModuleLoader \Support \ModuleRepository ;
78use Zonneplan \ModuleLoader \Test \TestCase ;
89
910class ModuleRepositoryTest extends TestCase
1011{
11- /* @var ModuleRepository */
12- protected $ moduleRepository ;
12+ protected ModuleRepository $ moduleRepository ;
1313
1414 public function setUp (): void
1515 {
You can’t perform that action at this time.
0 commit comments