froeschke / modular-laravel
0.0.1
2024-08-19 17:21 UTC
Requires
- illuminate/console: ^10.0|^11.0
- illuminate/filesystem: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
README
This packages simplifies making your Laravel application modular.
The structure is inspired by this Laracon Talk from Ryuta Hamasaki (Repository)
Setup
composer require --dev froeschke/modular-laravel
php artisan modules:install
Optional: Publish the config file
php artisan vendor:publish --provider="Froeschke\ModularLaravel\ModularLaravelServiceProvider"
Create a module
php artisan modules:create ModuleName
Fix modules structure
Since empty folders are not in saved in git, you can run the following command, to ensure every folder exists:
php artisan modules:fix
Testing
To enable tests, you need to modify your phpunit.xml
configuration.
Add the following two test suites (if you've changed the default paths, you may need to change the test path)
<testsuites> <testsuite name="Unit"> <directory suffix="Test.php">./modules/**/Tests/Unit</directory> </testsuite> <testsuite name="Feature"> <directory suffix="Test.php">./modules/**/Tests/Feature</directory> </testsuite> </testsuites>