Publish your module
Once your module is completed, you can distribute it as an installable Composer package.
How to publish your module ?
Section titled “How to publish your module ?”-
Convert your module into a package
Section titled “Convert your module into a package”Refer to the official guide on Laravel Package Development to structure your module as a standalone package. This includes:
- Creating a separate package directory
- Defining a dedicated
composer.json - Moving your module’s Service Provider and related files into the package
- Adding autoloading rules
-
Add required dependencies
Section titled “Add required dependencies”Ensure your package declares all necessary dependencies:
"require": {"php": "^8.3","illuminate/support": "^12.8","epsicube/support": "*"} -
Declare your module
Section titled “Declare your module”This section allows Epsicube to automatically detect and register your module:
"extra": {"epsicube": {"modules": ["YourModuleNamespace\\YourModule"]}} -
Publish the package to a Git repository
Section titled “Publish the package to a Git repository”Your Composer package must be hosted in a Git repository (GitHub, GitLab, Bitbucket, etc.). Make sure to include:
- A valid
composer.json - A tagged version (
git tag v0.0.1 && git push --tags) - PSR-4 autoloading
- A valid
-
Require the package in your application
Section titled “Require the package in your application”Once published, you can install it like any standard Composer dependency:
Terminal window composer require vendor/your-module-package -
Verify module discovery
Section titled “Verify module discovery”After installation:
- Epsicube will automatically detect your module via the
extra.epsicube.modulessection - Your module will be listed in
php artisan modules:status - If needed, enable it explicitly:
Terminal window php artisan modules:enable {identifier} - Epsicube will automatically detect your module via the
You can now distribute your module across multiple projects, version it, and maintain it as a standalone package.