Skip to content

make:module ​

Bootstrap a complete module

Signature: modularous:make:module

Aliases: m:m:m, unusual:make:module

Category: Make


Description ​

make:module is the primary entry point for creating a new Modularous module. It calls nWidart's module:make to create the folder skeleton, then immediately calls make:route with the same module name to generate the full first-route file set (model, controller, repository, migration, form request, and Vue stubs).


Usage ​

modularous:make:module [options] <module>

Arguments ​

ArgumentRequiredDescription
moduleyesPascalCase module name (e.g. Blog, UserProfile)

Options ​

OptionShortDescription
--schema=Schema fields for the initial migration (title:string,body:text)
--rules=Validation rules for the Form Request
--relationships=Relationship definitions forwarded to the model
--custom-model=Reuse an existing model class instead of generating a new one
--table-name=Override the auto-derived table name
--force-fOverwrite existing files
--systemCreate inside the Modularous system modules path
--no-migrateSkip running migrations after generation
--no-migrationSkip creating the migration file entirely
--no-defaultsSkip Modularous default fields (e.g. is_published)
--notAskSkip all interactive trait questions
--allAccept all trait questions with yes
--just-stubsOnly regenerate stubs for existing module routes
--stubs-only=Comma-separated list of stub types to include (used with --just-stubs)
--stubs-except=Comma-separated list of stub types to exclude (used with --just-stubs)
--testDry-run / preview mode

Trait flags ​

OptionShortDescription
--addTranslation-TAdd translatable content support
--addMedia-MAdd media/image attachment support
--addFile-FAdd file attachment support
--addPosition-PAdd sortable position support
--addSlug-SAdd slug generation support
--addAuthorized-AAdd scoped authorization
--addFilepond-FPAdd FilePond file upload support
--addUuidAdd UUID primary key support
--addSnapshot-SSAdd snapshot/versioning support
--addPriceAdd pricing trait

Examples ​

Minimal module ​

bash
php artisan modularous:make:module Blog

Module with schema and translation ​

bash
php artisan modularous:make:module Blog --schema="title:string,body:text" --addTranslation

Module with all options set non-interactively ​

bash
php artisan modularous:make:module Shop \
    --schema="name:string,price:decimal:8,2" \
    --rules="name:required|string,price:required|numeric" \
    --addTranslation \
    --addMedia \
    --addPrice \
    --notAsk

Re-generate stubs only for an existing module ​

bash
php artisan modularous:make:module Blog --just-stubs --stubs-except=migration

Preview without writing files ​

bash
php artisan modularous:make:module Blog --test

Notes ​

  • make:module wraps module:make (nWidart) + make:route — it does not generate anything itself.
  • Pass --system only when adding to the Modularous core; requires a non-production environment.
  • Use --just-stubs to fix or refresh stub files after changing the config without re-running migrations.

See also ​