Skip to content

Conversation

@abhihyder
Copy link
Contributor

📝 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:

  • Clearly explain the new route precedence behavior in Laravel
  • Warn developers that application routes may be ignored if they reuse package route names
  • Guide safe route overriding through config or environment variables
  • Include a practical example for developers to follow

🔍 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:

  • Developers will understand why route collisions occur
  • They will know how to explicitly override package routes
  • They will avoid routing issues during Laravel upgrades

🧪 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:

SHOPIFY_ROUTE_NAME_AUTHENTICATE_TOKEN="my.custom.callback"

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.

… to ensure

predictable route registration behavior in Laravel >= 12.29.0.
@abhihyder
Copy link
Contributor Author

@Kyon147 it's very important change. Check this as early as possible.

@Kyon147
Copy link
Owner

Kyon147 commented Nov 7, 2025

Hi @abhihyder thanks for the PR - great write up. I think it is worth us also adding an update to the wiki as well for this.

I'll also read up on the changes, and see what our options are long term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants