Skip to content

Commit

Permalink
Update webhook.md
Browse files Browse the repository at this point in the history
Since Laravel 11 the middlware is no longer included in the structure by default.
  • Loading branch information
TwilightDuck authored May 21, 2024
1 parent 735f683 commit fdb8307
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions docs/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ class MollieWebhookController extends Controller {

Finally, it is _strongly advised_ to disable the `VerifyCsrfToken` middleware, which is included in the `web` middleware group by default. (Out of the box, Laravel applies the `web` middleware group to all routes in `routes/web.php`.)

You can exclude URIs from the CSRF protection in the `app/Http/Middleware/VerifyCsrfToken.php` file:
You can exclude the route from the CSRF protection in your `bootstrap/app.php`:

```php
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'webhooks/mollie'
];
// bootstrap/app.php

->withMiddleware(function (Middleware $middleware) {
$middleware->validateCsrfTokens(
except: ['webhooks/mollie']
);
})
```

If this solution does not work, open an [issue](https://github.com/mollie/laravel-mollie/issues) so we can assist you.

0 comments on commit fdb8307

Please sign in to comment.