Bug: Replace dynamic route name resolution with hardcoded route names to ensure predictable route registration behavior in Laravel >= 12.29.0. #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
The Laravel framework team merged [PR #56920](laravel/framework#56920) which changes route‐name precedence: the first registered route wins. In Laravel v12.29.0, since packages often register routes before the application’s
RouteServiceProvider, package routes now take precedence over application-defined routes with the same name.This PR updates the package configuration comments to:
🔍 Why This Change Is Needed
Because of the change introduced in Laravel framework PR #56920, route name collisions now behave differently. Previously, application routes might override package routes. But now, if a package route is registered first, it wins. That change has caused unexpected routing in applications using this package.
By updating the documentation and configuration comments:
🧪 Impact
There are no breaking changes in this PR. The runtime behavior remains the same. The change is purely documentation- and configuration-based, enhancing clarity and developer experience.
✅ Example Scenario
An application defines the same callback route name as the package (e.g.,
authenticate.token). Because of Laravel PR #56920, if the package route was registered first, the application route is ignored.By customizing the route name via environment variable:
Then defining that route in the application, the application route will now take precedence.
📌 Notes
This update is compatible with all supported Laravel versions and addresses the new routing precedence behavior introduced in Laravel 12.29.0 via PR #56920.