konekt/concord
Laravel extension for building modular applications using conventions on top of service providers. Manage in-app and external modules with isolation-friendly structure, version compatibility across Laravel releases, and tooling around module registration and organization.
Modules and Boxes are all Laravel Service Providers. Therefore you can use all the features Laravel provides for package development.
Concord modules provide several convenience features compared to the base Laravel service providers.
One of those features is that some file groups are published by default.
Concord modules and boxes are publishing their migration, therefore they can be copied to the
application using the artisan vendor:publish command.
php artisan vendor:publish --provider="Vendor\Module\Providers\ModuleServiceProvider" --tag="migrations"
Using this feature is useful if you want your application to control the migrations. In this case you likely need to turn off the loading of migrations on the module level.
One of such use-cases is when you're using the modules in a multi-tenant environment. Depending on the setup, the tenant migrations have to be separated from the "landlord" migrations.
As an example see: Tenancy for Laravel or Spatie Laravel-Multitenancy.
It might be confusing, what is publishing and what is loading of migrations.
Loading is when a set of migrations are made visible for artisan migrate command.
These migrations are available to be executed on demand. See https://laravel.com/docs/11.x/packages#migrations
Publishing is when a set of files (eg. migrations) are made visible for the
artisan vendor:publish command. These files can be copied to your application's migrations
folder. See https://laravel.com/docs/11.x/packages#publishing-file-groups
The main differences are:
vendor:publish command again.Modules are "solo", therefore they only publish their very own migrations.
Boxes are meant to integrate several submodules, therefore you have 2 options:
php artisan vendor:publish --provider="Vendor\Box\Providers\ModuleServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Vendor\Box\Providers\ModuleServiceProvider" --tag="own-migrations-only"
How can I help you explore Laravel packages today?