Skip to content

Conversation

@alissn
Copy link
Contributor

@alissn alissn commented Dec 3, 2024

Hi,

In this pull request, I’ve added a prohibitDestructiveCommands method to the Module facade. This method allows you to indicate whether destructive Artisan commands should be prohibited, especially in production environments.

The commands affected are:

  • module:migrate-fresh
  • module:migrate-refresh
  • module:migrate-reset

Usage:

To enable this feature, add the following line to your service provider:

Module::prohibitDestructiveCommands($this->app->isProduction());

This ensures that these potentially harmful commands are disabled when running in a production environment, adding an extra layer of safety for your application.

Additionally, this PR updates the confirmable messages to provide clearer communication to users when running these commands.

Thanks.

@dcblogdev dcblogdev merged commit 79cdb18 into nWidart:master Dec 3, 2024
5 checks passed
@dcblogdev
Copy link
Collaborator

awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants