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

Framework Laravel Package

spiral/framework

Spiral Framework is a high-performance, long-running full-stack PHP framework built for RoadRunner. PSR-compliant components, resident memory kernel, and native support for queues, GRPC, WebSockets, and background workers.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • High-Performance Hybrid Runtime: Spiral’s RoadRunner integration (PHP + Go) enables long-lived processes, reducing cold starts and improving throughput for high-traffic applications. This aligns well with microservices, APIs, and real-time systems (WebSockets, gRPC).
  • PSR Compliance: Full adherence to PSR-3, PSR-7, PSR-11, PSR-15, PSR-16, PSR-17 ensures interoperability with Laravel’s ecosystem (e.g., Monolog, HTTP clients, caching).
  • Modular & Extensible: Bootloaders, bridges, and scaffolding allow incremental adoption—ideal for monolithic-to-microservices migration or feature-specific upgrades.
  • ORM & Database: Cycle ORM (not Eloquent) offers high performance and schema-first design, which may require refactoring if the team relies heavily on Laravel’s Eloquent.
  • Event-Driven & CQRS: Native support for events, queues, and workflows (Temporal) enables scalable async processing, but Laravel’s event system would need migration.

Integration Feasibility

  • Laravel Compatibility:
    • Pros:
      • Shared PSR standards (e.g., PSR-15 middleware, PSR-3 logging).
      • RoadRunner can replace Laravel’s built-in server (e.g., php-fpm).
      • Queue workers (AMQP, SQS, Kafka) are direct replacements for Laravel Queues.
    • Cons:
      • No Laravel-specific integrations (e.g., Blade, Artisan, Scout, Nova).
      • Service Container differences: Spiral uses dependency injection (DI) via attributes, while Laravel relies on bindings/configuration.
      • ORM mismatch: Cycle ORM ≠ Eloquent (requires data layer rewrite).
  • Migration Path:
    • Phased adoption:
      1. Replace Laravel’s HTTP layer with Spiral + RoadRunner (gains performance).
      2. Migrate queues/jobs to Spiral’s queue system.
      3. Refactor ORM (Cycle ORM) for database access.
      4. Replace Artisan commands with Spiral’s console system.
    • Hybrid approach: Use Laravel for legacy and Spiral for new microservices.

Technical Risk

Risk Area Severity Mitigation Strategy
ORM Migration High Use Cycle ORM’s Eloquent-like facade or write adapters.
Service Container Medium Leverage PSR-11 interfaces for shared dependencies.
Middleware/Routing Low Spiral’s PSR-15 middleware is compatible with Laravel’s.
Artisan Commands Medium Rewrite or use Spiral’s console system.
Third-Party Packages High Audit for Laravel-specific dependencies (e.g., Scout, Cashier).
Performance Gains Low Benchmark RoadRunner vs. Laravel’s server.

Key Questions

  1. Why Spiral?
    • Is the goal performance optimization, microservices decomposition, or long-term maintainability?
    • Does the team have Go/PHP hybrid experience (RoadRunner requires Go for some features).
  2. ORM Strategy
    • Can Cycle ORM replace Eloquent, or is a hybrid approach (e.g., Laravel for reads, Spiral for writes) viable?
  3. Team Skills
    • Is the team familiar with dependency injection, PSR standards, and attribute-based configuration?
  4. Ecosystem Lock-in
    • Are there critical Laravel packages (e.g., Laravel Cashier, Scout) that cannot be replaced?
  5. Deployment Model
    • Will the app run as long-lived processes (RoadRunner) or short-lived requests (traditional PHP-FPM)?

Integration Approach

Stack Fit

Component Laravel Equivalent Spiral Alternative Compatibility Notes
HTTP Server PHP-FPM / Swoole RoadRunner (PHP/Go) High (RoadRunner supports HTTP/2, FastCGI).
Routing Laravel Router Spiral Router (PSR-15) High (PSR-15 middleware interoperable).
Middleware Laravel Middleware PSR-15 Middleware High (direct replacement).
ORM Eloquent Cycle ORM Low (requires migration or adapters).
Queues Laravel Queues Spiral Queue (AMQP, SQS, etc.) High (same drivers, but different API).
Logging Monolog Monolog Bridge High (configurable via MONOLOG_FORMAT).
Authentication Laravel Auth Spiral Auth (RBAC, JWT, etc.) Medium (different middleware stack).
CLI Artisan Spiral Console Medium (rewrite commands).
Caching Laravel Cache PSR-16 Cache High (same interfaces).
Events Laravel Events Spiral Events (PSR-14) High (PSR-14 compatible).

Migration Path

Phase 1: Performance Optimization (Low Risk)

  • Replace Laravel’s HTTP server with RoadRunner.
    • Benefits: Lower latency, better concurrency, HTTP/2 support.
    • Implementation:
      composer require spiral/framework spiral/roadrunner-bridge
      
    • Configure roadrunner.yaml and update server.php to use Spiral’s kernel.
  • Migrate queues to Spiral’s queue system.
    • Replace Illuminate\Queue\QueueManager with Spiral\Queue\QueueManager.
    • Update job handlers to extend Spiral\Queue\JobInterface.

Phase 2: Core Framework (Medium Risk)

  • Replace Service Container:
    • Bind Laravel services to Spiral’s container using PSR-11 interfaces.
    • Example:
      $container->bindSingleton(\Illuminate\Contracts\Container::class, fn() => $laravelContainer);
      
  • Replace ORM (Highest Risk):
    • Option A: Cycle ORM (native Spiral ORM).
    • Option B: Write an Eloquent adapter for Cycle ORM.
    • Option C: Use both (Laravel for reads, Spiral for writes).

Phase 3: Full Migration (High Risk)

  • Replace Artisan commands with Spiral’s console system.
  • Replace Blade with Twig or Spiral’s template engine.
  • Replace Laravel-specific packages (e.g., Scout, Cashier) with alternatives or rewrite.

Compatibility

  • Pros:
    • PSR standards ensure interoperability with Laravel’s ecosystem.
    • RoadRunner is drop-in for HTTP (no code changes needed for routes/middleware).
    • Queue system is API-compatible with Laravel’s (same drivers).
  • Cons:
    • No Blade/Twig integration (must use Spiral’s template engine or Twig bridge).
    • Artisan commands must be rewritten.
    • Laravel-specific packages (e.g., Laravel Nova, Scout) cannot be used.

Sequencing

  1. Benchmark RoadRunner vs. Laravel’s server (ensure performance gains justify effort).
  2. Migrate queues first (low risk, high reward).
  3. Replace HTTP layer (RoadRunner).
  4. Refactor ORM (Cycle ORM or adapter).
  5. Replace CLI/Artisan (last step, as it’s most disruptive).

Operational Impact

Maintenance

  • Pros:
    • Long-lived processes (RoadRunner) reduce cold starts and memory churn.
    • Anti-memory-leak tools improve stability in long-running apps.
    • PSR compliance reduces vendor lock-in.
  • Cons:
    • New framework = new learning curve (Spiral’s DI, bootloaders, Cycle ORM).
    • Smaller ecosystem than Laravel (fewer community packages).
    • RoadRunner requires Go (additional dependency for some features).

Support

  • Pros:
    • MIT License (no licensing costs).
    • Active development (releases every
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.
hamzi/corewatch
minionfactory/raw-hydrator
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