Skip to content

Commit

Permalink
remove Route macro
Browse files Browse the repository at this point in the history
  • Loading branch information
josiasmontag committed Jun 23, 2019
1 parent aaa63c6 commit 6113c1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -102,13 +102,13 @@ This package can help you handle the CloudConvert webhooks. Out of the box it wi

You can create your webhook in the [webhook settings](https://cloudconvert.com/dashboard/api/v2/webhooks) and point it to something like `https://your.app/webhook/cloudconvert`. Make sure to to configure the shown signing secret in the config file of this package.

In the routes file of your app you must pass that route to the `Route::cloudConvertWebhooks` macro:
In the routes file of your app you must pass that route to a controller provided by this package.

```php
Route::cloudConvertWebhooks('webhook/cloudconvert');
Route::post('webhook/cloudconvert', '\CloudConvert\Laravel\CloudConvertWebhooksController');
```

Behind the scenes this will register a POST route to a controller provided by this package. Because CSRF token validation is not availble for this route, you must also add that route to the except array of the `VerifyCsrfToken` middleware:
Because CSRF token validation is not availble for this route, you must also add that route to the except array of the `VerifyCsrfToken` middleware:

```php
protected $except = [
Expand Down
5 changes: 0 additions & 5 deletions src/Providers/CloudConvertServiceProvider.php
Expand Up @@ -27,11 +27,6 @@ public function boot()
}
$this->mergeConfigFrom(__DIR__ . '/../config/cloudconvert.php', 'cloudconvert');


Route::macro('cloudConvertWebhooks', function ($url) {
return Route::post($url, '\CloudConvert\Laravel\CloudConvertWebhooksController');
});

}

/**
Expand Down

0 comments on commit 6113c1b

Please sign in to comment.