Skip to content
This documentation is in construction.

Write your own

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.


  1. Generate a new module using Laravel’s CLI:

    Terminal window
    php artisan make:module MyCustomModule
  2. Open the generated file app/Modules/MyCustomModule.php

    use 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 author
    description: '' // Add a description for your module
    );
    }
    //...
    }
  3. By default, the module:make command registers your module in bootstrap/modules.php.

    You may also manually create or update the bootstrap/modules.php file:

    <?php
    return [
    //...
    App\Modules\MyCustomModule::class,
    ];
  4. By default, the module:make command enables your module (unless you use the --disabled option).

    You may also enable it manually using:

    Terminal window
    php artisan modules:enable {identifier}
  • Package Development — Learn how to create reusable packages with configuration, migrations, assets, and service providers.