Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Vapor Core Laravel Package

laravel/vapor-core

Core runtime and service providers that power Laravel Vapor deployments on AWS Lambda. Helps Laravel apps run smoothly in serverless environments, integrating with SQS, databases, Redis, networking, CloudFront, and other AWS services used by Vapor.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Serverless Laravel Optimization: vapor-core is designed to abstract AWS Lambda complexities for Laravel, making it a natural fit for teams already using or evaluating Laravel Vapor as their serverless deployment platform. The package handles:
    • Lambda invocation lifecycle (e.g., cold start mitigation, execution context).
    • AWS service integrations (SQS, RDS, ElastiCache, S3-compatible storage).
    • Request/response transformations (e.g., API Gateway compatibility, multipart parsing).
  • Symfony 8/Laravel 13 Alignment: The package now supports Symfony 8 components, critical for Laravel 13 compatibility. This is a hard dependency if your stack includes Symfony-based dependencies (e.g., HTTP client, cache, messaging).
  • Modular Design: The core provides service providers and a runtime client, allowing granular adoption (e.g., use only the Lambda handler without full Vapor deployment).

Integration Feasibility

  • Laravel-Centric: Built for Laravel, with zero dependencies outside the Laravel ecosystem (except AWS SDK and Symfony 8 components). Integration is plug-and-play if using Laravel 10–13.
  • AWS-Centric: Requires AWS infrastructure (Lambda, SQS, RDS, etc.). Non-AWS deployments (e.g., Heroku, DigitalOcean) will need workarounds (e.g., S3-compatible storage fixes already exist).
  • Octane Support: Works with Laravel Octane (serverless HTTP layer), enabling high-performance serverless APIs. Confirmed fixes for Octane cookies and streamed responses in recent releases.
  • Database Resilience: Includes fixes for MySQL "server gone away" errors during wait_timeout resets, critical for serverless environments with ephemeral connections.

Technical Risk

Risk Area Severity Mitigation
Symfony 8 Dependency High Requires Laravel 13+. Test thoroughly if using Symfony components directly.
AWS Lock-in Medium Abstract AWS-specific logic if multi-cloud is a future goal.
Cold Start Overhead Medium Optimize Lambda memory/timeout settings; leverage Vapor’s provisioned concurrency.
Stateful Session Issues Medium Use ElastiCache (Redis) for session storage; avoid file-based sessions.
Multipart Request Parsing Low Fixed in v2.37.9; verify with complex payloads (e.g., file uploads).
Laravel Version Drift Low Package supports Laravel 10–13; pin version to avoid surprises.

Key Questions for the TPM

  1. AWS Dependency:
    • Is your team committed to AWS for this project, or could you abstract AWS-specific logic (e.g., using Bref for multi-cloud)?
  2. Laravel Version:
    • Are you on Laravel 10–13? If not, assess upgrade effort for Symfony 8 compatibility.
  3. Symfony Usage:
    • Do you use Symfony components (e.g., HttpClient, Cache)? If yes, this package ensures consistency.
  4. State Management:
    • How will you handle stateful operations (e.g., sessions, queues)? Vapor recommends ElastiCache or database-backed sessions.
  5. Observability:
    • Does your team need enhanced Lambda logging (e.g., execution context, API Gateway timestamps)? The package exposes these via VaporServiceProvider.
  6. Cost vs. Benefit:
    • Have you compared serverless costs (pay-per-use) vs. traditional EC2 (reserved instances) for your workload?
  7. Team Expertise:
    • Does your team have AWS Lambda/Laravel Vapor experience? If not, budget for training or hiring.
  8. Migration Path:
    • Are you starting from scratch or migrating an existing Laravel app? The latter may require refactoring (e.g., stateless design, queue workers).

Integration Approach

Stack Fit

  • Primary Use Case: Laravel 10–13 applications deployed on AWS Lambda via Laravel Vapor.
  • Complementary Tools:
    • AWS SDK for PHP: Required for direct AWS interactions (handled by Vapor).
    • Laravel Octane: For high-performance HTTP handling (confirmed compatible).
    • ElastiCache (Redis): Recommended for sessions/queues (serverless-friendly).
    • CloudFront: For CDN caching (integrates with Vapor’s API Gateway setup).
  • Anti-Patterns:
    • File-based storage: Avoid; use S3 or S3-compatible storage (e.g., MinIO).
    • Long-running processes: Lambda has a 15-minute max timeout; offload to EC2 or SQS if needed.
    • Shared state: Use database or Redis instead of file/environment variables.

Migration Path

Phase Action Items Dependencies
Assessment Audit app for stateful operations, Symfony dependencies, and AWS usage. DevOps, Backend
Proof of Concept Deploy a non-critical Laravel service to Vapor to test cold starts, costs. AWS Account, CI/CD
Refactoring - Replace file storage with S3. Storage Team
- Migrate sessions to Redis. Cache Team
- Convert queue workers to serverless-compatible (e.g., SQS triggers). Queue Team
Integration - Install vapor-core and vapor-cli. Backend
- Configure VaporServiceProvider in config/app.php. Backend
- Set up Lambda layers for shared dependencies (e.g., AWS SDK). DevOps
Testing - Test cold starts, concurrency, and error handling. QA
- Validate API Gateway integrations (e.g., custom domains, caching). Frontend
Deployment - Roll out to staging with canary releases. DevOps
- Monitor costs (AWS Lambda pricing) and performance (latency). Observability Team

Compatibility

  • Laravel Versions: 10–13 (explicitly tested; v2.43.5 adds Laravel 13/Symfony 8 support).
  • PHP Versions: 8.1–8.4 (PHP 8.4 deprecation warnings fixed in v2.37.10).
  • AWS Services:
    • Lambda: Core dependency.
    • API Gateway: For HTTP routing (timestamp headers added in v2.39.0).
    • SQS: For queues (custom event support in v2.41.0).
    • RDS/ElastiCache: For databases/cache (serverless ElastiCache support in v2.35.0).
    • S3: For storage (S3-compatible fixes in v2.38.0).
  • Third-Party:
    • Guzzle HTTP: Updated to v2.0 in v2.34.0.
    • Symfony Components: Hard dependency for Laravel 13 (e.g., HttpClient, Cache).

Sequencing

  1. Prerequisites:
    • Upgrade Laravel to 10–13 if not already done.
    • Set up AWS infrastructure (Lambda, SQS, RDS, etc.).
  2. Core Integration:
    • Add vapor-core to composer.json:
      composer require laravel/vapor-core
      
    • Register VaporServiceProvider in config/app.php:
      'providers' => [
          // ...
          Laravel\Vapor\Core\VaporServiceProvider::class,
      ],
      
  3. Configuration:
    • Set VAPOR_ENV in .env (non-standard environments).
    • Configure vapor.yml for AWS resources (e.g., memory, timeout).
  4. Testing:
    • Test Lambda invocations locally using vapor-cli.
    • Validate API Gateway integrations (e.g., custom domains, caching).
  5. Optimization:
    • Tune Lambda memory/timeout based on workload.
    • Enable provisioned concurrency for critical paths.

Operational Impact

Maintenance

  • Dependency Updates:
    • vapor-core follows Laravel’s release cadence. Plan for quarterly updates to align with Laravel/Symfony.
    • Monitor **AWS
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai