- Can I use spiral/marshaller-bridge in a Laravel project?
- No, this package is designed exclusively for Spiral Framework and lacks Laravel-specific integrations. It won’t work out-of-the-box with Laravel’s service container, Eloquent, or Blade. Manual wiring would be required, but it’s not recommended due to compatibility risks.
- What Laravel alternatives exist for data marshalling like Spiral’s?
- For Laravel, consider **spatie/laravel-data** (DTOs), **Fractal** (API responses), or **Symfony Serializer** (flexible serialization). These are actively maintained, Laravel-native, and avoid Spiral’s ecosystem dependencies.
- How do I install spiral/marshaller-bridge in a Laravel project?
- You can install it via Composer (`composer require spiral/marshaller-bridge`), but it’s **not Laravel-compatible**. The package requires Spiral Framework (v3.0+) and won’t integrate with Laravel’s DI container or Eloquent models without heavy customization.
- Does this package support Laravel’s Eloquent models for serialization?
- No, spiral/marshaller-bridge has no built-in Eloquent support. You’d need to manually map models to Spiral’s marshalling types, which is error-prone and unsupported. Laravel’s native tools like **spatie/laravel-data** handle Eloquent seamlessly.
- Is spiral/marshaller-bridge actively maintained for Laravel?
- No, the package is **Spiral-only** with no Laravel-focused updates since 2023-10-05. The latest changes (e.g., CI/CD updates) are irrelevant to Laravel. The maintainers show no interest in Laravel compatibility.
- Will this package break if Spiral’s marshalling logic changes?
- Yes, since it’s tightly coupled to Spiral’s internals. If Spiral updates its `MarshallerInterface` or dependencies, this bridge could fail without Laravel-specific fixes. No guarantees exist for long-term stability in Laravel.
- Can I replace Symfony Serializer with spiral/marshaller-bridge in Laravel?
- No, this package replaces Spiral’s `SerializerBootloader`, not Symfony’s. Laravel’s Symfony Serializer integration is more mature, with better type support and Laravel-specific optimizations. Stick with Symfony or **spatie/laravel-data** for DTOs.
- How do I configure custom type matchers in Laravel with this package?
- You can configure `mapperFactory` and `matchers` in `app/config/marshaller.php`, but this **won’t work in Laravel** without Spiral’s DI container. Laravel uses its own configuration system (e.g., `config/marshaller.php` won’t auto-load).
- Are there performance benefits to using Spiral’s marshaller in Laravel?
- No, there’s no evidence of Laravel-specific optimizations. Spiral’s marshalling layer is **not portable** to Laravel’s architecture. Native Laravel tools like **Fractal** or **spatie/laravel-data** are optimized for Laravel’s performance and memory usage.
- What’s the migration path if I’m switching from Spiral to Laravel?
- Avoid this bridge—it offers no migration aid. Instead, audit your marshalling logic and replace Spiral’s marshaller with **spatie/laravel-data** (DTOs) or **Fractal** (API responses). If you’re tied to Spiral’s logic, extract a custom marshaller without the bridge.