below are mentioned things to be taken care of at the time of deploying a laravel project to production.

  • Make site down for maintenance ( php artisan down )
  • clear all manual changes if any ( git reset –hard )
  • Sync with mater from VCS ( production will always be in sync with master, git pull origin master )
  • Install/update composer dependencies ( composer install –no-interaction –prefer-dist –optimize-autoloader –no-dev )
  • Run database migrations ( php artisan migrate –force )
  • Clear caches ( php artisan cache:clear )
  • Clear expired password reset tokens ( php artisan auth:clear-resets )
  • Clear and cache routes ( php artisan route:clear, php artisan route:cache )
  • Clear and cache config ( php artisan config:cache, php artisan config:clear )
  • Install/update node js dependencies ( npm install )
  • Compile the resources ( npm run prod )
  • Make site Up ( php artisan up )