Deployment & DevOps

Interview Questions: Forge, Vapor, and Env Management

Q1: What is the difference between Laravel Forge and Laravel Vapor?

Forge: A server management tool. It provisions and manages traditional VPS servers (DigitalOcean, AWS EC2, Linode) for you. You still "own" the server.

Vapor: A serverless deployment platform for AWS Lambda. It handles auto-scaling automatically, and you don't manage any servers.

Q2: What steps are critical when deploying to production?

  • Set APP_ENV=production and APP_DEBUG=false.
  • Run optimizations: config:cache, route:cache, view:cache.
  • Run database migrations: migrate --force.
  • Install dependencies without dev packages: composer install --optimize-autoloader --no-dev.
  • Compile assets: npm run build.

Q3: How do you manage environment variables securely?

.env file: Never commit this to version control.

CI/CD: Inject secrets via your CI/CD provider (GitHub Actions secrets).

Production: On Forge/Vapor, use their UI to manage environment variables, which are then injected into the server/lambda environment.