- How do I install reindeer/symfony-middleware in a Laravel application?
- Install the package with Composer using composer require reindeer/symfony-middleware. It has a minimal footprint with no heavy dependencies, so there is no extra bootstrapping step to wire up. Middleware is then registered through a single configuration entry point rather than being attached to controllers or event subscribers. Check the repository README for the exact config file location and registration syntax for your version.
- Which Laravel and PHP versions does this package support?
- The package is a lightweight bridge with minimal dependencies, so its Laravel and PHP constraints are declared in its composer.json rather than in marketing copy. Always open composer.json or run composer why-not reindeer/symfony-middleware to confirm compatibility before upgrading Laravel or PHP. Because the integration is framework-native and requires no adapters, upgrades are usually limited to matching the declared version constraints.
- Is reindeer/symfony-middleware actually PSR-15 compatible?
- Yes. The package exposes a PSR-15 compatible middleware interface, so middleware written against that standard can be reused without modification. That makes components portable between projects and easier to unit test in isolation. You still get framework-native request and response handling inside Laravel, with no adapter layer required.
- How does middleware ordering work in this package?
- Ordering is priority-based, so execution flow stays explicit and debuggable instead of depending on registration side effects. Middleware runs as a composable layer before and after the application kernel handles the request. Give higher-priority middleware to logic that must short-circuit early, such as authentication or CORS handling, and lower priority to post-processing like logging or response headers.
- Can I reuse existing Symfony middleware inside Laravel with this package?
- That is the core purpose of the package. It provides a lightweight bridge that lets Symfony-style middleware run alongside Laravel's request pipeline, so you do not need to rewrite existing components. Because the middleware is PSR-15 compatible and framework-native, the same class can often serve both a Symfony app and a Laravel app. Some middleware that depends on Symfony-specific services may still need small adjustments.
- How do I register middleware with reindeer/symfony-middleware?
- Registration goes through a single configuration entry point, keeping setup out of controllers and event subscribers. You list each middleware class with its priority so the pipeline order is readable at a glance. This keeps request-wrapping logic composable and easy to reorder without touching application code.
- Does adding a middleware pipeline slow down my Laravel application?
- The package is deliberately minimal, with no heavy dependencies and no extra bootstrapping overhead. Each middleware adds only the cost of its own logic plus a single pass through the pipeline. Keep middleware focused and avoid blocking I/O in layers that run on every request to keep latency predictable.
- What can I use Symfony-style middleware for in a Laravel app?
- Typical uses include logging, authentication checks, CORS headers, request normalization, and any custom logic that should wrap request handling. Because middleware is composable, you can stack these concerns in a predictable order instead of scattering them across controllers. This is especially useful when the same logic must be shared with a Symfony application.
- How do I test middleware built with this package?
- Since the middleware follows a PSR-15 style interface, you can unit test each layer in isolation by passing a fake request and a stub request handler, then asserting on the returned response. For integration coverage, send requests through Laravel's test helpers and assert the pipeline order and final response. Testing priority ordering explicitly is worthwhile, since ordering bugs are the most common pipeline issue.
- How does this compare to Laravel's native middleware or Symfony event subscribers?
- Laravel's native middleware is the simplest choice for Laravel-only projects, while Symfony event subscribers suit logic tightly coupled to Symfony's kernel events. reindeer/symfony-middleware is the better fit when you want portable PSR-15 components, explicit priority ordering, and a shared pipeline across Laravel and Symfony without adapters. Before adopting it in production, review recent releases and pin a tested version in composer.json.