laravel/vapor-core
Core runtime and service providers for running Laravel apps on Laravel Vapor (AWS Lambda). Handles serverless bootstrapping and integrations with queues, databases, Redis, networking, CloudFront, and more for smooth, scalable deployments.
vapor-core package integrates via service providers, requiring only:
composer require laravel/vapor-coreconfig/vapor.php (if needed).vapor.yml for GitHub Actions/GitLab CI pipelines, enabling zero-downtime deployments via AWS CodeDeploy.| Risk Area | Mitigation | Severity |
|---|---|---|
| Cold Starts | Octane integration (pre-warmed containers) and Lambda Provisioned Concurrency can reduce latency to <500ms p99. Monitor with Vapor’s built-in metrics. | Medium |
| Vendor Lock-In (AWS) | Abstract AWS-specific logic behind Laravel interfaces (e.g., Vapor::queue()). Use adapters for multi-cloud portability (e.g., switch to Bref for non-AWS). |
Low |
| Stateful Sessions | Vapor supports Redis/ElastiCache for session storage. Avoid file-based sessions. Use Vapor::isRunningOnVapor() to conditionally enable serverless-compatible session drivers. |
High |
| Concurrency Limits | AWS Lambda has 1,000 concurrent executions by default. Request increases via AWS Support or use reserved concurrency. Monitor with CloudWatch. | Medium |
| Debugging Complexity | Lambda’s ephemeral nature complicates debugging. Use X-Ray integration (via Vapor) and structured logging (Vapor::log()). Local testing with vapor test or SAM CLI. |
Medium |
| Cost Overruns | Lambda pricing is pay-per-use, but unoptimized code (e.g., long-running jobs) can inflate costs. Use AWS Cost Explorer and Vapor’s memory/timeout tuning to optimize. | High |
| Legacy Laravel Features | Some features (e.g., artisan commands, cron) require workarounds. Vapor provides CLI handlers and scheduler proxies for serverless compatibility. Test thoroughly. |
Medium |
Traffic Patterns:
State Management:
Async Workloads:
Team Skills:
Cost Sensitivity:
Multi-Region Needs:
Compliance & Security:
Migration Strategy:
Core Stack Compatibility:
Non-Compatible Stacks:
| Phase | Actions | Tools/Dependencies | Risk |
|---|---|---|---|
| Assessment | Audit app for statefulness, long-running processes, and AWS dependencies. Identify cold-start-sensitive endpoints. | Laravel Pint, PHPStan, AWS Well-Architected Tool | Low |
| Local Testing | Set up Vapor CLI and test locally using vapor test. Mock Lambda events (API Gateway, SQS). |
Vapor CLI, SAM CLI, LocalStack | Medium |
| Feature Flag Rollout | Deploy non-critical endpoints (e.g., /health, /webhooks) to Vapor first. Use feature flags to toggle traffic. |
Laravel Feature Flags, CloudFront | Medium |
| Async Workloads | Migrate queues and cron jobs to Vapor’s SQS/EventBridge integrations. Replace schedule:run with Vapor’s scheduler proxy. |
Laravel Horizon (optional), EventBridge | High |
| Database Optimization | Enable RDS Proxy to manage connections in serverless. Adjust wait_timeout and connection pooling. |
RDS Proxy, Laravel Database Observability | High |
| Octane Integration | For high-performance APIs, add Octane to reduce cold starts. Configure Provisioned Concurrency for critical paths. | Laravel Octane, AWS Lambda Power Tuning Tool | Medium |
| Multi-Region | Deploy to secondary regions using CloudFront and Route 53 |
How can I help you explore Laravel packages today?