Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GuntarV's avatar
Level 40

Artisan commands to run after code changes in production

I got new project that I am working on. Updates and changes are quite frequent. What artisan commands should I run after pushing the changes to production?

This is what I am doing currently

php artisan route:clear
php artisan view:clear
php artisan permission:cache-reset // for spaty's roles and permissions package
php artisan cache:clear
php artisan queue:restart
php artisan config:clear
php artisan optimize

After that I also restart the supervisor on the server.

Am I doing it right and in correct order? Doses the order matters?

Thank you.

0 likes
4 replies
automica's avatar

you can reduce a lot of those by running php artisan optimize:clear

php artisan optimize:clear
php artisan permission:cache-reset // for spaty's roles and permissions package
php artisan queue:restart
php artisan optimize
GuntarV's avatar
Level 40

Thank you @automica for suggestion.

After researching a bit more about the commands I am planning to run these artisan commands after code updates in production:

php artisan cache:clear
php artisan auth:clear-resets
php artisan view:cache
php artisan optimize
markokaup's avatar

@GuntarV Hey! Old thread but how did you end up with these? Asking for a Friend... ;)

GuntarV's avatar
Level 40

@markokaup, I am running the commands listed in my listed reply, which are:

php artisan cache:clear
php artisan auth:clear-resets
php artisan view:cache
php artisan optimize

Are you having some challenges? Why do you ask?

Please or to participate in this conversation.