Dynamic Routes #102
-
A question rather than an issue... In its current form, can the package handle dynamic routes for incoming webhooks? That is, instead of hard-coding:
Is it possible to do this:
Then, have the controller pick off $endpoint for additional processing? Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Figured this out with a little help from @gaetanodegennaro. Here's how to make this method work. (NB: Step 2 was key for me).
Many thanks to @gaetanodegennaro for the initial clues. |
Beta Was this translation helpful? Give feedback.
Figured this out with a little help from @gaetanodegennaro. Here's how to make this method work. (NB: Step 2 was key for me).
Define a parameter in your route definition (i.e. web.php) in the following format: Route::webhooks('mypath/{id}', 'config-name');
IMPORTANT: Update VerifyCsrfToken.php to include a wildcard asterisk symbol at the end of your excluded route as follows:
$id = Route::current()->parameter('id');
Many thanks to @gaetanodegennaro for the initial clues.