Weave 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
Symfony Middleware Bundle

Symfony Middleware Bundle Laravel Package

pierotto/symfony-middleware-bundle

pierotto/symfony-middleware-bundle adds a simple middleware pipeline to Symfony apps, letting you run reusable layers before and after controllers for auth, logging, CORS, caching, and other cross-cutting concerns without cluttering controllers.

View on GitHub
Deep Wiki
Context7

This Symfony extension allows for the integration of middleware into your application, providing a streamlined approach to handling HTTP requests and responses.

Frequently asked questions about Symfony Middleware Bundle
What does pierotto/symfony-middleware-bundle do?
It adds a simple middleware pipeline so you can run reusable layers before and after your controllers. Typical uses are authentication, logging, CORS headers, caching, and other cross-cutting concerns without cluttering controller code. The package builds on Symfony components and is intended to slot into Laravel-style applications.
How do I install pierotto/symfony-middleware-bundle with Composer?
Install it with composer require pierotto/symfony-middleware-bundle, then register the bundle or service provider according to the repository README. The README excerpt is not included in this listing, so confirm the exact registration step on GitHub before wiring it in. Run composer why pierotto/symfony-middleware-bundle afterwards to verify which Symfony component versions were resolved.
Does version 1.1.0 support Symfony 6 and Symfony 7 at the same time?
Release notes for 1.1.0 only state that Symfony 7.0 component support was added. It is not documented whether the change widens constraints so Symfony 6 and 7 both work, or replaces Symfony 6 with Symfony 7. Inspect composer.json and the changelog to confirm before upgrading, because the two outcomes carry very different upgrade costs.
Which Laravel and PHP versions does this package support?
No explicit support matrix is published in the material available here, and Composer constraints were not provided. Symfony 7 components align with Laravel 11 and 12 on PHP 8.2 or newer, so that stack is the safest bet. Verify the required PHP version and Laravel range in the package composer.json before adopting it.
How do I add middleware to the pipeline for auth, logging or CORS?
You write a middleware class and register it in the pipeline, which then executes it before and after the controller. The exact registration API is described in the package README, which should be checked for the correct service tag or config key. Keep each middleware single-purpose so ordering stays predictable across the request lifecycle.
Will this package conflict with Laravel's built-in HTTP middleware?
The main risk is not direct conflict but transitive dependency resolution against the Illuminate stack. Because the package pulls Symfony components, Composer may resolve component versions that clash with your current Laravel minor. Check the dependency tree and test on your exact Laravel version rather than assuming compatibility from a minor version bump.
Is it safe to upgrade to 1.1.0 in an existing Laravel 10 application?
Laravel 10 projects usually run Symfony 6 components, so only upgrade if 1.1.0 still allows Symfony 6. If the constraints narrowed to require Symfony 7, upgrading the package alone would force a platform jump. Upgrade Laravel, Symfony, and this package in lockstep, or stay on the previous package version until you move platforms.
What are the production risks of adding this middleware bundle?
Installation risk is lower than runtime risk: deprecations, stricter Symfony 7 behaviour, and transitive dependency conflicts are the main concerns. If the middleware touches the request lifecycle, a failure can affect every route. Roll out behind a feature flag and monitor error rates and response times after enabling it.
How should I test the middleware pipeline before rolling it out?
Pin version 1.1.0 in a branch and run CI against the Laravel and Symfony versions you actually deploy. Add integration tests that exercise the request lifecycle, including the middleware ordering and any short-circuit responses. Then validate in staging before enabling it in production.
Is pierotto/symfony-middleware-bundle actively maintained, and are there alternatives?
The most recent signal available is the 1.1.0 release adding Symfony 7 component support, which suggests the package is being kept compatible with modern stacks. There is no published support policy or test matrix, so ask for one if you depend on it long term. Alternatives include Laravel's native HTTP middleware and event system, which cover most of the same cross-cutting concerns without an extra dependency.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager