Answers for "setup laravel for production"

PHP
1

laravel production

Apply changes to .env file:
APP_ENV=production
APP_DEBUG=false
Make sure that you are optimizing Composer's class autoloader map (docs):
composer dump-autoload --optimize
or along install: composer install --optimize-autoloader --no-dev
or during update: composer update --optimize-autoloader
Optimizing Configuration Loading:

php artisan config:cache
Optimizing Route Loading

php artisan route:cache
Compile all of the application's Blade templates:
php artisan view:cache
Cache the framework bootstrap files:

php artisan optimize
(Optional) Compiling assets (docs):

npm run production
(Optional) Generate the encryption keys Laravel Passport needs (docs):

php artisan passport:keys
(Optional) Start Laravel task scheduler by adding the following Cron entry (docs):

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
(Optional) Install, config and start the Supervisor (docs):

(Optional) Create a symbolic link from public/storage to storage/app/public (docs):
php artisan storage:link
Laravel deployment docs: https://laravel.com/docs/master/deployment
Digital Ocean's tutorial: How to Install and Configure Laravel
Posted by: Guest on July-05-2021
4

laravel deployment

composer install --optimize-autoloader --no-dev
Posted by: Guest on November-24-2020
0

laravel set production

APP_ENV=production
APP_DEBUG=false
Posted by: Guest on October-10-2021

Browse Popular Code Answers by Language