Write your own
Module Structure
Section titled “Module Structure”A module is a standard Laravel Service Provider that additionally implements the
Epsicube\Support\Contracts\Module interface.
This contract exposes the metadata required by Epsicube to register, identify, and manage your module.
How to Create a Module?
Section titled “How to Create a Module?”-
Create a Service Provider
Section titled “Create a Service Provider”Generate a new module using Laravel’s CLI:
Terminal window php artisan make:module MyCustomModule -
Define Metadata
Section titled “Define Metadata”Open the generated file
app/Modules/MyCustomModule.phpuse Illuminate\Support\ServiceProvider;use Epsicube\Support\Contracts\Module;use Epsicube\Support\ModuleIdentity;class MyCustomModule extends ServiceProvider implements Module{public function identifier(): string{return 'custom::your-custom-module';}public function identity(): ModuleIdentity{return ModuleIdentity::make(name: "MyCustomModule",version: "0.0.1",author: "", // Provide information about the authordescription: '' // Add a description for your module);}//...} -
Register the Module
Section titled “Register the Module”By default, the
module:makecommand registers your module inbootstrap/modules.php.You may also manually create or update the
bootstrap/modules.phpfile:<?phpreturn [//...App\Modules\MyCustomModule::class,]; -
Enable the Module
Section titled “Enable the Module”By default, the
module:makecommand enables your module (unless you use the--disabledoption).You may also enable it manually using:
Terminal window php artisan modules:enable {identifier}
Related Laravel Documentation
Section titled “Related Laravel Documentation”- Package Development — Learn how to create reusable packages with configuration, migrations, assets, and service providers.