These commands create files inside your modules. They support all standard Laravel flags (like -m, -c, -r).
[!TIP] Custom Per-Module Stubs (v1.1.5+) The
make:*commands will automatically scan inside your module for astubs/directory first before falling back to application stubs. This allows you to completely override Laravel's generator scaffolding exclusively for one specific module! (e.g.,modules/Shop/stubs/controller.model.stub)
make:moduleCreates a brand new module with the full directory structure.
php artisan make:module Shop
What it does:
module.json, composer.json, package.json, vite.config.js..gitignore and .gitattributes.ShopServiceProvider.composer.json autoloading (PSR-4).make:modelCreates an Eloquent model.
php artisan make:model Product --module=Shop
Options:
-m, --migration: Create a migration file.-c, --controller: Create a controller.-r, --resource: Controller should be a Resource Controller.-f, --factory: Create a factory.-s, --seed: Create a seeder.--policy: Create a policy.-a, --all: Do EVERYTHING (migration, factory, seeder, policy, controller, resource).Example:
# Create Model + Migration + Factory + Resource Controller
php artisan make:model Order --module=Shop -mfr
make:controllerCreates a controller class.
php artisan make:controller ProductController --module=Shop
Options:
--resource: Generate a resource controller (index, create, store...).--api: Generate an API controller (no create/edit methods).--model=Product: Bind the controller to a model.make:migrationCreates a database migration.
php artisan make:migration create_orders_table --module=Shop
File Location:
Creates modules/Shop/database/migrations/xxxx_xx_xx_create_orders_table.php.
All of these work exactly as you expect, just add --module=Name.
make:command (Console Command)make:component (Blade Component)make:eventmake:factorymake:jobmake:listenermake:mailmake:middlewaremake:notificationmake:observermake:policymake:providermake:request (Form Request)make:resource (API Resource)make:rulemake:seedermake:testmodular:*)commands to manage the lifecycle and state of your modules.
modular:listDisplays a table of all modules, their status (Enabled/Disabled), and path.
php artisan modular:list
# Visualize dependencies in an ASCII tree!
php artisan modular:list --tree
modular:migrateMigrate the database.
# Migrate ALL enabled modules + core app
php artisan modular:migrate
# Migrate ONLY the Shop module
php artisan modular:migrate Shop
# Rollback migrations for ONLY the Shop module
php artisan modular:migrate Shop --rollback
# Rollback exactly 2 steps for the Shop module
php artisan modular:migrate Shop --rollback --step=2
modular:seedRun database seeders.
# Seed 'Shop' module (looks for Shop\Database\Seeders\ShopSeeder)
php artisan modular:seed Shop
modular:testRun PHPUnit/Pest tests with isolation.
php artisan modular:test Shop
# Run tests with unified coverage (requires phpunit/phpcov)
php artisan modular:test --coverage-html=coverage-report
Coverage Options:
--coverage: Enable coverage collection.--coverage-clover={path}: Export Clover XML.--coverage-html={path}: Export HTML report.Note: Individual module coverage is collected in isolation and merged into a single report.
modular:npmRun NPM commands inside a module's directory.
# Install a package for Shop
php artisan modular:npm Shop install chart.js
# Build assets for Shop
php artisan modular:npm Shop run build
modular:syncThis command is critical for large teams. It scans all packages/modular/*/composer.json files and merges their requirements into the root composer.json (into a requires section managed by the package).
Note: This usually happens automatically during make:module, but run this if you manually edit dependencies.
php artisan modular:sync
modular:checkChecks for circular dependencies between modules.
php artisan modular:check
modular:linkSymlinks module public assets to the public/ directory.
php artisan modular:link
modular:cacheCreate a cache file for faster module discovery. Checks for config, views, translations, and migrations.
php artisan modular:cache
modular:clearRemove the modular discovery cache file.
php artisan modular:clear
modular:debugDebug module configuration, providers, and middleware.
# Debug all modules summary
php artisan modular:debug
# Debug a specific module (deep dive)
php artisan modular:debug Shop
modular:ide-helperGenerate a helper file (_ide_helper_modular.php) to help IDEs auto-complete module names.
php artisan modular:ide-helper
modular:doctorDiagnose common configuration issues and architectural integrity.
php artisan modular:doctor
What it checks:
composer.json.modular:check logic.module.json and basic directory structure.module.json.public/modules directory exists.modular:publishPublish configuration and stub files for customization.
php artisan modular:publish
config to publish config/modular.php.stubs to publish generator stubs.module:enableEnable a module instantly.
php artisan module:enable Shop
Note: Enabled modules are verified for dependencies. If a module requires another module that is currently disabled, the command will fail.
module:disableDisable a module instantly.
php artisan module:disable Shop
Disabled modules are not loaded, their routes are 404, and their services are not booted.
module:uninstallUninstall (delete) a module.
# Uninstall the Shop module
php artisan module:uninstall Shop
# Force uninstall in production
php artisan module:uninstall Shop --force
How can I help you explore Laravel packages today?