1Apply changes to .env file:
2APP_ENV=production
3APP_DEBUG=false
4Make sure that you are optimizing Composer's class autoloader map (docs):
5composer dump-autoload --optimize
6or along install: composer install --optimize-autoloader --no-dev
7or during update: composer update --optimize-autoloader
8Optimizing Configuration Loading:
9
10php artisan config:cache
11Optimizing Route Loading
12
13php artisan route:cache
14Compile all of the application's Blade templates:
15php artisan view:cache
16Cache the framework bootstrap files:
17
18php artisan optimize
19(Optional) Compiling assets (docs):
20
21npm run production
22(Optional) Generate the encryption keys Laravel Passport needs (docs):
23
24php artisan passport:keys
25(Optional) Start Laravel task scheduler by adding the following Cron entry (docs):
26
27* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
28(Optional) Install, config and start the Supervisor (docs):
29
30(Optional) Create a symbolic link from public/storage to storage/app/public (docs):
31php artisan storage:link
32Laravel deployment docs: https://laravel.com/docs/master/deployment
33Digital Ocean's tutorial: How to Install and Configure Laravel