Skip to content

Enable and disable modules

Change a module’s status to turn it on or off. A disabled module stays on disk, but the package does not register its service providers or routes.

Terminal window
php artisan module:disable Blog

The command prints Disabling Blog Module, old status: Enabled.

Terminal window
php artisan module:enable Blog

Pass multiple names, or use --all to target every module:

Terminal window
php artisan module:disable Blog Shop
php artisan module:enable --all

If any name does not exist, the command stops before changing anything. It prints an error (such as ERROR Module [Nope] does not exist.) and exits with status 1.

use Nwidart\Modules\Facades\Module;
Module::disable('Blog');
Module::findOrFail('Blog')->enable();

Check the current status with Module::isEnabled('Blog').

Status changes take effect on the next HTTP request or Artisan run, because module providers register during boot.

The default activator writes statuses to modules_statuses.json in the application root. Any module missing from that file counts as disabled, including modules discovered from extra scan paths or vendor/ (see Load modules from extra locations).

To store statuses elsewhere, see Store module status with a custom activator.

Terminal window
php artisan module:list

Each module shows [Enabled] or [Disabled]. Add --only=enabled to list enabled modules only. Run php artisan route:list --name=blog to confirm routes disappear while Blog is disabled.