- Is atoolo/rewrite-bundle compatible with Laravel?
- Not directly. atoolo/rewrite-bundle is a Symfony bundle built around Symfony Config, DependencyInjection, and HttpKernel, so a pure Laravel app cannot install and use it as a native package. Laravel teams can evaluate it through a Symfony bridge or by porting the rewrite rules into Laravel middleware.
- How do I install atoolo/rewrite-bundle in a Laravel application?
- You normally cannot install it with Composer into Laravel and expect it to boot as a Laravel service provider. A realistic approach is a proof of concept that wraps the Symfony rewrite handler in Laravel middleware, or a hybrid setup that registers Symfony services through a bridge. Start with one rewrite rule and verify routing precedence before expanding.
- What PHP and Symfony versions does atoolo/rewrite-bundle support?
- The README lists PHP 8.2, 8.3, and 8.4 badges, with PHP 8.1 shown as no longer checked automatically. The bundle targets Symfony 6.3+ or 7.x according to the technical evaluation. Check the repository before adopting it because Laravel version support depends on the PHP version you run.
- Can atoolo/rewrite-bundle handle legacy URL redirects in a Laravel project?
- The bundle is designed for flexible URL rewriting and cleanup, including legacy URL cleanup and redirects, but those features are exposed through Symfony. In Laravel you would need to intercept requests in middleware and call equivalent rewrite logic before Laravel's router processes the path. It is better suited to static config-driven rules than dynamic API-generated URLs.
- How does atoolo/rewrite-bundle compare with Laravel middleware or Spatie URL rewriting packages?
- atoolo/rewrite-bundle is Symfony-native and not a drop-in Laravel package, while Laravel-native packages and custom middleware are built for Laravel's router and container. If you want minimal integration risk in a pure Laravel app, a Laravel-native package or a small middleware is usually simpler. Consider atoolo only if you already use Symfony components or need its specific rewrite handler architecture.
- Do I need Symfony to use atoolo/rewrite-bundle?
- Yes, the bundle depends on Symfony components such as Config, DependencyInjection, and HttpKernel. Without Symfony's container and kernel, you would have to reimplement or wrap the rewrite behavior yourself. A Laravel-only stack should treat it as a reference implementation rather than a direct dependency.
- How do I configure multilingual URL rewrites like /en/old-url to /new-url?
- The bundle's rewrite context and handlers support language-aware rules in Symfony configuration, but Laravel does not read Symfony YAML or XML config natively. In Laravel you would map those rules into config files, a database table, or middleware parameters. Test language prefixes and fallback behavior carefully so rewrites do not collide with Laravel route groups.
- What performance risks come with using atoolo/rewrite-bundle in Laravel?
- Every request must pass through rewrite matching, and Symfony's event system can add latency compared with a small Laravel middleware. The risk grows with the number of active rules and complex handlers such as SameNavigationUrlRewriteHandler. Benchmark with realistic rule counts and cache compiled rules where possible before production.
- How should I test URL rewrites and circular redirects with atoolo/rewrite-bundle?
- The project includes E2E tests and passes PHPStan level 9, but Laravel integration tests still need to cover your own middleware order and route precedence. Add tests for successful rewrites, missing targets, language variants, and circular redirect chains. Verify whether a failed rewrite should return 404 or fall through to the next handler.
- Is atoolo/rewrite-bundle production-ready and actively maintained?
- It has documentation, E2E tests, and PHPStan level 9, and it is part of the Atoolo suite under an MIT license. Adoption is low, so validate the specific rewrite scenarios you need and review recent commits before relying on it. For Laravel, the bigger risk is integration complexity rather than the bundle's code quality.