modules:list command displays a table of all registered modules in your Laravel application, including their names, file system paths, and PHP namespaces.
Usage
What It Does
- Scans the module registry for all installed modules
- Displays module count summary
- Shows a formatted table with module details
- Automatically adjusts column headers based on namespace configuration
Example Output
Single module
Multiple modules
Module with multiple namespaces
If a module registers multiple namespaces, the table adjusts automatically:The column header changes from “Namespace” to “Namespaces” (plural) when any module has multiple namespaces registered.
Output Details
Module Column
Displays the module’s composer package name (typically in kebab-case).Path Column
Shows the relative path from your Laravel application root to the module directory. Paths are normalized to use forward slashes for consistency across operating systems.Namespace Column
Lists the PHP namespace(s) registered by the module. Multiple namespaces are comma-separated.When to Use
Usemodules:list to:
- Verify module installation - Confirm a module is properly registered
- Check namespace configuration - See the actual namespaces Laravel will use
- Debug autoloading issues - Verify paths and namespaces match expectations
- Get an overview - See all modules at a glance during development
- Document your architecture - Capture current module structure
No Modules Installed
If no modules are found:Troubleshooting
Module not appearing in list?
- Check composer.json - Ensure the module is in your root
composer.jsonrequire section - Run composer update - Install the module dependency:
- Clear module cache - Refresh the module registry:
- Verify module structure - Ensure the module has a valid
composer.jsonwith proper autoload configuration
Wrong namespace showing?
The namespace comes from your module’scomposer.json autoload configuration. Check the PSR-4 autoload section:
Related Commands
- make:module - Create a new module
- modules:cache - Cache module registry for performance
- modules:clear - Clear module cache
- modules:sync - Sync IDE and test configuration