Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route caching fails when multiple routes use same configuration #209

Closed
ryanlholt opened this issue Apr 22, 2024 · 0 comments · Fixed by #210
Closed

Route caching fails when multiple routes use same configuration #209

ryanlholt opened this issue Apr 22, 2024 · 0 comments · Fixed by #210

Comments

@ryanlholt
Copy link
Contributor

Description

If two or more routes use the same configuration name then route caching fails. According to this section of the README, multiple routes should be acceptable for a single webhook configuration. Looking in Spatie\WebhookClient\WebhookClientServiceProvider, it appears that the route macro simply appends the configuration name to magic string. This leads to non-unique names for routes which are a problem when routes are serialized during caching.

Steps To Reproduce

  • Add Route::webhooks('receiving-url-for-app-1', 'default', 'get') to your routes file
  • Add Route::webhooks('receiving-url-for-app-1', 'default', 'post') to your routes file
  • Run php artisan route:cache or php artisan optimize to cache the routes.
  • See that a LogicException is thrown when serialization is attempted.

Screenshots

Screenshot 2024-04-22 at 11 43 52 AM Screenshot 2024-04-22 at 11 43 38 AM
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 a pull request may close this issue.

1 participant