Skip to content

Installation Steps (for production)

Kevin edited this page Nov 15, 2023 · 3 revisions

Installation Steps

1. Apply changes to .env file:

APP_ENV=production

APP_DEBUG=false

2. 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

3. Optimizing Configuration Loading:

php artisan config:cache

4. Optimizing Route Loading

php artisan route:cache

5. Compile all of the application's Blade templates:

php artisan view:cache

6. Cache the framework bootstrap files:

php artisan optimize

7. (Optional) Compiling assets (docs)

npm run production

8. (Optional) Generate the encryption keys Laravel Passport needs (docs)

php artisan passport:keys

9. (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

10. ((Optional) Install, config and start the Supervisor (docs)

11. ((Optional) Create a symbolic link from public/storage to storage/app/public (docs)

php artisan storage:link

12. Run admin Seeder

php artisan db:seed --class=PermissionTableSeeder php artisan db:seed --class=CreateAdminUserSeeder


Laravel deployment docs


Source