Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are the common environment variables used in Laravel Sail


What are the common environment variables used in Laravel Sail


The common environment variables used in Laravel Sail are:

1. Database Configuration:
- `DB_CONNECTION`: The database connection to use (e.g., `mysql`, `pgsql`, `sqlite`, `sqlsrv`).
- `DB_HOST`: The database host address.
- `DB_PORT`: The database port number.
- `DB_DATABASE`: The name of the database.
- `DB_USERNAME`: The database username.
- `DB_PASSWORD`: The database password.

2. Redis Configuration:
- `REDIS_HOST`: The Redis host address.
- `REDIS_PASSWORD`: The Redis password (if applicable).
- `REDIS_PORT`: The Redis port number.

3. Mail Configuration:
- `MAIL_MAILER`: The mail driver to use (e.g., `smtp`, `sendmail`, `mailgun`, `ses`, `postmark`, `log`, `array`).
- `MAIL_HOST`: The mail host address.
- `MAIL_PORT`: The mail host port.
- `MAIL_USERNAME`: The mail username.
- `MAIL_PASSWORD`: The mail password.
- `MAIL_ENCRYPTION`: The mail encryption protocol (e.g., `ssl`, `tls`).
- `MAIL_FROM_ADDRESS`: The "from" address of any outgoing messages.
- `MAIL_FROM_NAME`: The "from" name of any outgoing messages.

4. Broadcast Configuration:
- `BROADCAST_DRIVER`: The broadcast driver to use (e.g., `log`, `pusher`, `redis`, `null`).
- `PUSHER_APP_ID`: The Pusher app ID (if using the Pusher driver).
- `PUSHER_APP_KEY`: The Pusher app key (if using the Pusher driver).
- `PUSHER_APP_SECRET`: The Pusher app secret (if using the Pusher driver).
- `PUSHER_APP_CLUSTER`: The Pusher app cluster (if using the Pusher driver).

5. Cache Configuration:
- `CACHE_DRIVER`: The cache driver to use (e.g., `file`, `database`, `memcached`, `redis`).

6. Session Configuration:
- `SESSION_DRIVER`: The session driver to use (e.g., `file`, `database`, `memcached`, `redis`).

7. Twill Configuration:
- `ADMIN_APP_PATH`: The path for the Twill admin console (e.g., `/admin`).
- `ADMIN_APP_URL`: The URL for the Twill admin console (e.g., `https://admin.example.com`).

8. Other Configuration:
- `APP_ENV`: The current application environment (e.g., `local`, `staging`, `production`).
- `APP_DEBUG`: Whether to enable debug mode (`true` or `false`).
- `APP_KEY`: The application encryption key.
- `LOG_CHANNEL`: The logging channel to use (e.g., `stack`, `daily`, `syslog`, `errorlog`).

These are the most common environment variables used in a Laravel Sail setup. Depending on your application's specific requirements, you may need to add or modify additional environment variables.

Citations:
[1] https://demos.pixinvent.com/vuexy-vuejs-admin-template/documentation/guide/laravel-integration/laravel-sail-docker.html
[2] https://tech.osteel.me/posts/you-dont-need-laravel-sail
[3] https://laracasts.com/discuss/channels/general-discussion/sail-does-not-load-environment-variables-on-apple-m1
[4] https://wpwebinfotech.com/blog/guide-to-laravel-sail/
[5] https://github.com/jedymatt/laravel-sail-env