.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
string
default:"Laravel"
The name of your application. This is used throughout the app and in email notifications.
string
default:"local"
The application environment. Use
local for development, staging for staging, and production for production.This affects debug output and error reporting behavior.
string
required
The application encryption key. Auto-generated when you run
php artisan key:generate.boolean
default:"true"
Enable or disable debug mode. Set to
false in production to hide detailed error messages.URL Configuration
string
default:"saas-starter-vue.test"
The base domain for your application. This is used for tenant subdomain generation.
string
default:"http://${APP_URL_BASE}"
The full URL of your application including protocol. Supports variable substitution from
APP_URL_BASE.Localization
string
default:"en"
The default locale for your application.
string
default:"en"
The fallback locale when a translation is not available in the current locale.
string
default:"en_US"
The locale used by Faker for generating test data.
Security
integer
default:"12"
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
string
default:"stack"
The default log channel. Options:
stack, single, daily, slack, syslog, errorlogstring
default:"daily"
When using the stack channel, this determines the channels to use.
string
default:"null"
Channel for logging PHP and Laravel deprecation warnings.
string
default:"debug"
Minimum log level to record. Options:
debug, info, notice, warning, error, critical, alert, emergencySession & Cache
string
default:"database"
Where to store session data. Options:
file, cookie, database, memcached, redis, arrayinteger
default:"120"
Session lifetime in minutes.
string
default:"database"
The default cache store. Options:
file, database, redis, memcached, arraystring
default:"database"
Queue driver for background jobs. Options:
sync, database, redis, sqs, beanstalkdStorage & Broadcasting
string
default:"local"
Default filesystem disk for file storage. Options:
local, public, s3string
default:"log"
Default broadcast driver for real-time events. Options:
pusher, redis, log, nullAWS Configuration
Required if using S3 for file storage:string
Your AWS access key ID.
string
Your AWS secret access key.
string
default:"us-east-1"
The AWS region for your S3 bucket.
string
The name of your S3 bucket.
Vite Build Configuration
string
default:"${APP_NAME}"
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