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
Laravel Route Names

Laravel Route Names Laravel Package

dragon-code/laravel-route-names

Automatically generates names for your Laravel routes based on controller classes and methods, so you never name routes by hand. Keeps naming consistent across your app, makes refactoring safer, and works alongside your existing route definitions.

View on GitHub
Deep Wiki
Context7

Automatic generation of route names for your project

Frequently asked questions about Laravel Route Names
How do I install dragon-code/laravel-route-names in a Laravel app?
Install it with composer require dragon-code/laravel-route-names. The package ships with Laravel service provider auto-discovery, so there is no manual provider registration. You can optionally publish its config file if you want to tune naming rules, and you can enable it globally or per route file. There are no migrations, queues, or database tables involved.
Which Laravel versions does laravel-route-names support?
The 2.2.0 release added Laravel 13 compatibility, and the maintainer has historically shipped major-version support promptly. Check the composer.json constraints for the exact range your installed version allows before upgrading a production app. Because the package hooks into the route registration lifecycle, confirm support for your specific Laravel major rather than assuming forward compatibility.
How does laravel-route-names generate route names automatically?
It hooks into Laravel's route registration lifecycle and derives a route name from the route definition, typically from the controller class and method or the URI shape. That removes the need to hand-write ->name('users.index') on every route. The result is consistent naming across a large route table without relying on scattered string literals.
Does laravel-route-names ever override an explicit ->name() call?
Precedence between generated names and explicit ->name() calls is not clearly documented, and the 2.2.0 release did not change or clarify that behavior. Before adopting it, write a small test that names a route explicitly and confirms the generated name does not clobber it. If precedence matters for your app, verify it on the exact version you plan to ship.
Can I customize the naming rules and separators?
Yes. The package exposes configurable naming rules and separators, which you set through the optional published config file. That lets you align generated names with your existing conventions, such as dot versus dash separators or a particular casing style. Keep the config in version control so naming stays stable across environments.
Does it support grouped and prefixed routes?
Yes, grouped and prefixed routes are supported, so generated names account for the surrounding route group structure. This is what keeps names unique and readable when you split routes across modules or admin and public route files. Test one representative group early to confirm the generated output matches what your route() calls and redirects expect.
What happens if two routes generate the same name?
Collision handling is undocumented, and the 2.2.0 release did nothing to change it. That is the biggest open risk with this package, because a silent duplicate name produces wrong URLs, broken signed URLs, and tests that pass while asserting the wrong route. Run a duplicate-name check across your full route table before relying on generated names in production, and decide in advance whether a collision should fail loudly.
Does laravel-route-names work with php artisan route:cache?
Route names are resolved when routes are registered, and route caching serializes the resolved names, so the package is generally compatible with cached routes. The 2.2.0 release made no changes to route-cache behavior, which means any quirks present in earlier 2.x versions remain. Always run a route:cache and route:clear cycle in a staging deploy before trusting it in production.
Will auto-generated route names break my Ziggy or frontend route helpers?
Auto-generated names become a public contract the moment a tool like Ziggy exposes them to JavaScript. Renaming a controller method then silently renames a frontend-visible route, so frontend links can break without any backend test failing. Treat generated names as part of your API surface: pin them in tests and review controller renames the same way you would review a route name change.
Is dragon-code/laravel-route-names actively maintained and safe for production?
It is maintained by a single author, and 2.2.0 was essentially a Laravel 13 compatibility commit alongside README and banner changes. That is better than an archived package, but it is compatibility-only maintenance, not active feature development. The code footprint is small and installation is low-risk, yet it mutates route names on boot, which is a high-leverage seam used by URL generation, signed URLs, and route assertions. With roughly 25 stars and no significant downstream validation, plan to own the edge cases yourself.
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
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect