Documentation Index
Fetch the complete documentation index at: https://forge.laravel.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Laravel Forge makes it easy to manage environment variables for your sites. If your project contains a.env file, you can easily create and edit environment variables from the “Environment” tab of your site’s settings.
Modifying environment variables
To modify your site’s environment variables, navigate to your site’s “Settings” panel and click on the “Environment” sidebar item. When you modify environment variables through Forge, the changes are written directly to the.env file within your application. If you’re using zero-downtime deployments, this file will be symlinked into the current release directory, ensuring your environment configuration is consistent across deployments.
After modifying your environment variables, you can optionally choose to automatically run:
- php artisan config:cache - Caches your configuration files for improved performance.
- php artisan queue:restart - Gracefully restarts your queue workers to pick up the new environment values.
Encrypted environment files
Laravel Forge provides support for Laravel’s encrypted environment files without requiring you to include your encryption key within your deployment script. To leverage this feature, add your encryption key to the “Encrypted environment files” section of your site’s “Environment” tab. Once added, Laravel Forge will inject the value into theLARAVEL_ENV_ENCRYPTION_KEY environment variable during deployments, allowing you to add the env:decrypt Artisan command to your deployment script without needing to specify the --key option manually.
Laravel integrations
The following Laravel-specific features are only available to sites using the Laravel or Statamic project type:- php artisan config:cache - Automatically cache configuration files after updating environment variables.
- php artisan queue:restart - Automatically restart queue workers after updating environment variables.
- Encrypted environment files - Support for Laravel’s encrypted environment files feature.