netgusto/autoroute-bundle
AutoRouteBundle is a Symfony bundle that automatically registers routes for controller actions using convention-based URLs, so you can expose endpoints without editing routing files. It scans your controllers, keeps route definitions close to the code, and simplifies setup with minimal configuration...
Autoroute is a route-generation bundle: instead of hand-writing an entry in routing.yml for every controller action, you point the bundle at a controller namespace and it derives routes from class/method names. Before adopting it, do three things:
composer.json and compare the symfony/framework-bundle and php constraints against your project. On Symfony 4+ (Flex) or PHP 8+, assume you will need to fork or patch it.new Netgusto\AutorouteBundle\AutorouteBundle(), to AppKernel::registerBundles(). In a modern app you'd wire it via bundles.php and likely fix deprecations along the way.app/config/routing.yml under a prefix, using the bundle's custom loader type (verify the exact type/loader name in the bundle's Routing/ directory — that is the one piece worth reading the source for).First use case: take a controller with indexAction, showAction, and editAction and make them reachable at predictable URLs without touching routing.yml. Run php app/console router:debug (or bin/console debug:router on newer Symfony) to see exactly what was generated before you build anything on top of it.
Route::resource mindset: one import line covers a whole controller, not one line per action.routing.yml/attribute definition and only autoroute the CRUD-ish controllers. Generated routes should be the default, not the contract.debug:router output before and after so you can see exactly what autoroute added and which existing routes it shadowed.path('foo_show', ...)). If the bundle's naming convention doesn't line up, wrap or alias it rather than editing every template.cache:clear and cache:warmup — otherwise the router keeps serving the stale map.debug:router contains the routes you expect. The bundle ships nothing you can trust, so your own integration check is the only guarantee generation hasn't silently broken.Routing/ and DependencyInjection/ before it touches production, and prefer Symfony's built-in attribute routing if you're on Symfony 5+.AppKernel, services.yml, PHP 5-style code. Registering it in a Symfony 6/7 app is a porting project, not a composer require.debug:router --show-controllers.debug:router, debug:router <name>, and inspect the compiled routing cache. There is no bundle-specific debug UI. If a route shows in debug:router but 404s at runtime, suspect a stale cache first.php artisan route:list.How can I help you explore Laravel packages today?