.env file in your project root.
Initial Setup
Copy the example environment file to create your configuration:.env file, generate an application key:
Application Settings
The name of your application. This is used throughout the app and in email notifications.
The application environment. Use
local for development, staging for staging, and production for production.This affects debug output and error reporting behavior.
The application encryption key. Auto-generated when you run
php artisan key:generate.Enable or disable debug mode. Set to
false in production to hide detailed error messages.URL Configuration
The base domain for your application. This is used for tenant subdomain generation.
The full URL of your application including protocol. Supports variable substitution from
APP_URL_BASE.Localization
The default locale for your application.
The fallback locale when a translation is not available in the current locale.
The locale used by Faker for generating test data.
Security
The number of rounds for bcrypt password hashing. Higher values increase security but require more CPU.
The default of 12 rounds provides good security for most applications.
Logging
The default log channel. Options:
stack, single, daily, slack, syslog, errorlogWhen using the stack channel, this determines the channels to use.
Channel for logging PHP and Laravel deprecation warnings.
Minimum log level to record. Options:
debug, info, notice, warning, error, critical, alert, emergencySession & Cache
Where to store session data. Options:
file, cookie, database, memcached, redis, arraySession lifetime in minutes.
The default cache store. Options:
file, database, redis, memcached, arrayQueue driver for background jobs. Options:
sync, database, redis, sqs, beanstalkdStorage & Broadcasting
Default filesystem disk for file storage. Options:
local, public, s3Default broadcast driver for real-time events. Options:
pusher, redis, log, nullAWS Configuration
Required if using S3 for file storage:Your AWS access key ID.
Your AWS secret access key.
The AWS region for your S3 bucket.
The name of your S3 bucket.
Vite Build Configuration
Application name passed to Vite for frontend builds.
Example Configuration
Security Best Practices
- Use different
APP_KEYvalues for each environment - Set
APP_DEBUG=falsein production - Use strong, unique passwords for database and cache connections
- Store sensitive credentials in your hosting provider’s secret management system
- Regularly rotate API keys and credentials
Next Steps
After configuring your environment variables:- Set up your database connection and run migrations
- Configure email for sending transactional emails
- Start the development server with
php artisan serve