Skip to content

Delete a module

To remove the Blog module from your application, roll back its migrations and run module:delete. The command deletes the module folder and removes its entry from the activator.

  1. Roll back the module’s migrations first. Once the module folder is deleted, its migration files are gone and cannot be rolled back.

    Terminal window
    php artisan module:migrate-reset Blog
  2. Delete the module.

    Terminal window
    php artisan module:delete Blog

    module:delete asks for confirmation in every environment. Pass --force to skip the prompt:

    Terminal window
    php artisan module:delete Blog --force

    List multiple names to delete several modules, or pass --all to delete every module.

  3. Rebuild the autoloader so Composer drops the deleted module’s classes.

    Terminal window
    composer dump-autoload
  4. Check the result.

    Terminal window
    php artisan module:list

    Blog no longer appears in the list, Modules/Blog is gone, and modules_statuses.json no longer contains Blog.

module:delete removes only the module folder and its status entry. Manually delete any files you published out of the module, such as assets in public/modules/blog, published migrations, or published translations.