Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Disable specific artisan commands when 'APP_ENV=production' #168

Closed
kevinvdburgt opened this issue Aug 20, 2016 · 5 comments
Closed

Disable specific artisan commands when 'APP_ENV=production' #168

kevinvdburgt opened this issue Aug 20, 2016 · 5 comments

Comments

@kevinvdburgt
Copy link

Yesterday i was thinking of the following situation:

What if you are running php artisan on a production environment, why should i ever use php artisan make:(model, controller etc..)? Instead, isnt it just a better option to disable/hide some artisan commands when the APP_ENV has been set on production?

@brayniverse
Copy link

Migrations ask you to confirm when on production env, maybe we can prompt people before performing the tasks.

@jlaswell
Copy link

There is a package that allows for this functionality if required. I'm not a fan of making decisions to inhibit developers by disabling or hiding things, but I can understand a prompt. I don't this this should be part of core either way.

https://github.com/Indatus/guardian

@brayniverse
Copy link

brayniverse commented Aug 20, 2016

I concur that to inhibit developers from executing certain artisan commands in production environments is not a good idea. However, I disagree that precautions should not be part of the core framework. Confirming before migrating in a production environment has saved my arse on multiple occasions. That said, I don't see value in confirming before executing or disabling any of the "make" commands because I don't see them as harmful like migrations and seeding can be.

What arguments are there for preventing "make" commands on production? Other than you don't think you would ever need to do it. And are there any other commands that we should consider?

@kevinvdburgt
Copy link
Author

The reason behind this is that server admins are messing around with artisan commands (some sysadmin of a client was already messing around with the make command...).

However, I think the package @jlaswell mentioned kinda will do the trick.

@sisve
Copy link

sisve commented Feb 1, 2018

... server admins are messing around ...

There's an attack vector that cannot be solved with code. Have you tried shock collars?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants