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\IsModule 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\IsModule;
    use Epsicube\Support\Modules\Identity;
    use Epsicube\Support\Modules\Module;
    class MyCustomModule extends ServiceProvider implements IsModule
    {
    public function module(): Module
    {
    return Module::make('custom::your-module-identifier', '0.0.1')
    ->providers(static::class)
    ->identity(fn (Identity $identity) => $identity
    ->name('MyCustomModule')
    ->description('')
    ->author('Internal dev')
    );
    }
    //...
    }
  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.