Skip to content

Instantly share code, notes, and snippets.

@malitta
Created October 23, 2016 06:38
Show Gist options
  • Save malitta/d4b609c73eb78d5b5432e5afbd8a82ae to your computer and use it in GitHub Desktop.
Save malitta/d4b609c73eb78d5b5432e5afbd8a82ae to your computer and use it in GitHub Desktop.
Deploying Laravel project on a production server

Setting up

Make sure .env file contain the following

  • APP_URL set to the correct publicly accessible URL
  • Doesn't have the APP_ENV so app is in production mode
  • APP_DEBUG=false to disable debug mode

Updating the application

After pulling new changes from git, make sure you do the following.

composer install to install dependencies.

php artisan migrate to run migrations.

Run the following commands to optimize the app.

composer dump-autoload
php artisan clear-compiled
php artisan config:cache
php artisan route:cache
php artisan optimize --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment