Skip to content

Adds a mention to autoreloading and using multiple processes #10243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Environment Configuration](#environment-configuration)
- [Environment Variable Types](#environment-variable-types)
- [Retrieving Environment Configuration](#retrieving-environment-configuration)
- [Auto-reloading Environment Variables Changes](#auto-reloading-env-changes)
- [Determining the Current Environment](#determining-the-current-environment)
- [Encrypting Environment Files](#encrypting-environment-files)
- [Accessing Configuration Values](#accessing-configuration-values)
Expand Down Expand Up @@ -103,6 +104,19 @@ All of the variables listed in the `.env` file will be loaded into the `$_ENV` P

The second value passed to the `env` function is the "default value". This value will be returned if no environment variable exists for the given key.

<a name="auto-reloading-env-changes"></a>
### Auto-reloading Environment Variables Changes

When serving your application using the `php artisan serve` command, Laravel will automatically detect and apply changes made to your `.env` file without requiring you to restart the development server. You may disable this automatic reloading behavior, you may use the `--no-reload` option when invoking the command:

```bash
php artisan serve --no-reload
```

The auto-reloading behavior is automatically disabled when using the `PHP_CLI_WORKER_SERVERS` configuration to start multiple worker processes.

If you have either disabled the behavior or are using multiple processes, you need to manually restart the command when you may changes to the `.env` file.

<a name="determining-the-current-environment"></a>
### Determining the Current Environment

Expand Down