You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The classname of the model to be used. The class should equal or extend
@@ -77,17 +77,18 @@ php artisan migrate
77
77
### Routing
78
78
Finally, take care of the routing: At [the Mailgun dashboard](https://app.mailgun.com/app/sending/domains) you must configure at what url Mailgun webhooks should hit your app. In the routes file of your app you must pass that route to `Route::mailgunWebhooks()`:
79
79
80
-
I like to group functionality by domain, so would suggest `webwooks\mailgun`
80
+
I like to group functionality by domain, so I would suggest `webwooks/mailgun` (especially if you plan to have more webhooks), but it is up to you.
81
81
82
82
```php
83
-
Route::mailgunWebhooks('webwooks\mailgun');
83
+
# routes\web.php
84
+
Route::mailgunWebhooks('webwooks/mailgun');
84
85
```
85
86
86
87
Behind the scenes this will register a `POST` route to a controller provided by this package. Because Mailgun has no way of getting a csrf-token, you must add that route to the `except` array of the `VerifyCsrfToken` middleware:
87
88
88
89
```php
89
90
protected $except = [
90
-
'webwooks\mailgun',
91
+
'webwooks/mailgun',
91
92
];
92
93
```
93
94
@@ -118,13 +119,13 @@ use Illuminate\Bus\Queueable;
118
119
use Illuminate\Queue\SerializesModels;
119
120
use Illuminate\Queue\InteractsWithQueue;
120
121
use Illuminate\Contracts\Queue\ShouldQueue;
121
-
use BinaryCats\MailgunWebhooks\WebhookCall;
122
+
use Spatie\WebhookClient\Models\WebhookCall;
122
123
123
-
class HandleDeliveredSource implements ShouldQueue
124
+
class HandleDelivered implements ShouldQueue
124
125
{
125
126
use InteractsWithQueue, Queueable, SerializesModels;
public function __construct(WebhookCall $webhookCall)
@@ -206,7 +207,7 @@ The above example is only one way to handle events in Laravel. To learn the othe
206
207
All incoming webhook requests are written to the database. This is incredibly valuable when something goes wrong while handling a webhook call. You can easily retry processing the webhook call, after you've investigated and fixed the cause of failure, like this:
207
208
208
209
```php
209
-
use BinaryCats\MailgunWebhooks\WebhookCall;
210
+
use Spatie\WebhookClient\Models\WebhookCall;
210
211
use BinaryCats\MailgunWebhooks\ProcessMailgunWebhookJob;
If this route parameter is present the verify middleware will look for the secret using a different config key, by appending the given the parameter value to the default config key. E.g. If Mailgun posts to `webhook-url/my-named-secret` you'd add a new config named `signing_secret_my-named-secret`.
253
+
If this route parameter is present the verify middleware will look for the secret using a different config key, by appending the given the parameter value to the default config key. E.g. If Mailgun posts to `webwooks/mailgun/my-named-secret` you'd add a new config named `signing_secret_my-named-secret`.
253
254
254
255
Example config might look like:
255
256
256
257
```php
257
-
// secret for when Mailgun posts to webhook-url/account
258
+
// secret for when Mailgun posts to webwooks/mailgun/account
258
259
'signing_secret_account' => 'whsec_abc',
259
-
// secret for when Mailgun posts to webhook-url/connect
260
-
'signing_secret_connect' => 'whsec_123',
260
+
// secret for when Mailgun posts to webwooks/mailgun/my-named-secret
0 commit comments