Skip to main content
The SaaS Starter Vue application uses Laravel’s environment configuration system. All configuration values are stored in the .env file in your project root.

Initial Setup

Copy the example environment file to create your configuration:
cp .env.example .env
After creating your .env file, generate an application key:
php artisan key:generate

Application Settings

APP_NAME
string
default:"Laravel"
The name of your application. This is used throughout the app and in email notifications.
APP_ENV
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.
APP_KEY
string
required
The application encryption key. Auto-generated when you run php artisan key:generate.
Never commit this value to version control. Each environment should have a unique key.
APP_DEBUG
boolean
default:"true"
Enable or disable debug mode. Set to false in production to hide detailed error messages.
Always set to false in production to avoid exposing sensitive information.

URL Configuration

APP_URL_BASE
string
default:"saas-starter-vue.test"
The base domain for your application. This is used for tenant subdomain generation.
APP_URL
string
default:"http://${APP_URL_BASE}"
The full URL of your application including protocol. Supports variable substitution from APP_URL_BASE.
APP_URL_BASE=saas-starter-vue.test
APP_URL=http://${APP_URL_BASE}

Localization

APP_LOCALE
string
default:"en"
The default locale for your application.
APP_FALLBACK_LOCALE
string
default:"en"
The fallback locale when a translation is not available in the current locale.
APP_FAKER_LOCALE
string
default:"en_US"
The locale used by Faker for generating test data.

Security

BCRYPT_ROUNDS
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

LOG_CHANNEL
string
default:"stack"
The default log channel. Options: stack, single, daily, slack, syslog, errorlog
LOG_STACK
string
default:"daily"
When using the stack channel, this determines the channels to use.
LOG_DEPRECATIONS_CHANNEL
string
default:"null"
Channel for logging PHP and Laravel deprecation warnings.
LOG_LEVEL
string
default:"debug"
Minimum log level to record. Options: debug, info, notice, warning, error, critical, alert, emergency

Session & Cache

SESSION_DRIVER
string
default:"database"
Where to store session data. Options: file, cookie, database, memcached, redis, array
SESSION_LIFETIME
integer
default:"120"
Session lifetime in minutes.
CACHE_STORE
string
default:"database"
The default cache store. Options: file, database, redis, memcached, array
QUEUE_CONNECTION
string
default:"database"
Queue driver for background jobs. Options: sync, database, redis, sqs, beanstalkd

Storage & Broadcasting

FILESYSTEM_DISK
string
default:"local"
Default filesystem disk for file storage. Options: local, public, s3
BROADCAST_CONNECTION
string
default:"log"
Default broadcast driver for real-time events. Options: pusher, redis, log, null

AWS Configuration

Required if using S3 for file storage:
AWS_ACCESS_KEY_ID
string
Your AWS access key ID.
AWS_SECRET_ACCESS_KEY
string
Your AWS secret access key.
AWS_DEFAULT_REGION
string
default:"us-east-1"
The AWS region for your S3 bucket.
AWS_BUCKET
string
The name of your S3 bucket.

Vite Build Configuration

VITE_APP_NAME
string
default:"${APP_NAME}"
Application name passed to Vite for frontend builds.

Example Configuration

APP_NAME="My SaaS App"
APP_ENV=local
APP_KEY=base64:your-generated-key-here
APP_DEBUG=true

APP_URL_BASE=myapp.test
APP_URL=http://${APP_URL_BASE}

APP_LOCALE=en
APP_FALLBACK_LOCALE=en

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=myapp
DB_USERNAME=postgres
DB_PASSWORD=secret

SESSION_DRIVER=database
CACHE_STORE=database
QUEUE_CONNECTION=database

Security Best Practices

Never commit your .env file to version control! The .env file is already included in .gitignore.
  • Use different APP_KEY values for each environment
  • Set APP_DEBUG=false in 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:
  1. Set up your database connection and run migrations
  2. Configure email for sending transactional emails
  3. Start the development server with php artisan serve

Build docs developers (and LLMs) love