Skip to content

Commit dd8ccd1

Browse files
authored
Merge pull request #3 from binary-cats/fix/readme
Update README.md
2 parents 7e88f8e + d987d1f commit dd8ccd1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ php artisan migrate
7878
### Routing
7979
Finally, take care of the routing: At [the Lob.com dashboard](https://dashboard.lob.com/#/webhooks) you must configure at what url Lob.com webhooks should hit your app. In the routes file of your app you must pass that route to `Route::lobWebhooks()`:
8080

81-
I like to group functionality by domain, so would suggest `webwooks\lob`
81+
I like to group functionality by domain, so would suggest `webhooks/lob`
8282

8383
```php
84-
Route::lobWebhooks('webwooks\lob');
84+
Route::lobWebhooks('webhooks/lob');
8585
```
8686

8787
Behind the scenes this will register a `POST` route to a controller provided by this package. Because Lob.com has no way of getting a csrf-token, you must add that route to the `except` array of the `VerifyCsrfToken` middleware:
8888

8989
```php
9090
protected $except = [
91-
'webwooks\lob',
91+
'webhooks/lob',
9292
];
9393
```
9494

@@ -117,13 +117,13 @@ use Illuminate\Bus\Queueable;
117117
use Illuminate\Queue\SerializesModels;
118118
use Illuminate\Queue\InteractsWithQueue;
119119
use Illuminate\Contracts\Queue\ShouldQueue;
120-
use BinaryCats\LobWebhooks\WebhookCall;
120+
use Spatie\WebhookClient\Models\WebhookCall;
121121

122122
class HandleDeliveredSource implements ShouldQueue
123123
{
124124
use InteractsWithQueue, Queueable, SerializesModels;
125125

126-
/** @var \BinaryCats\LobWebhooks\WebhookCall */
126+
/** @var \Spatie\WebhookClient\Models\WebhookCall */
127127
public $webhookCall;
128128

129129
public function __construct(WebhookCall $webhookCall)
@@ -181,7 +181,7 @@ Here's an example of such a listener:
181181
namespace App\Listeners;
182182

183183
use Illuminate\Contracts\Queue\ShouldQueue;
184-
use BinaryCats\LobWebhooks\WebhookCall;
184+
use Spatie\WebhookClient\Models\WebhookCall;
185185

186186
class LetterCreatedListener implements ShouldQueue
187187
{
@@ -205,8 +205,8 @@ The above example is only one way to handle events in Laravel. To learn the othe
205205
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:
206206

207207
```php
208-
use BinaryCats\LobWebhooks\WebhookCall;
209208
use BinaryCats\LobWebhooks\ProcessLobWebhookJob;
209+
use Spatie\WebhookClient\Models\WebhookCall;
210210

211211
dispatch(new ProcessLobWebhookJob(WebhookCall::find($id)));
212212
```
@@ -236,26 +236,26 @@ class MyCustomLobWebhookJob extends ProcessLobWebhookJob
236236

237237
When needed might want to the package to handle multiple endpoints and secrets. Here's how to configurate that behaviour.
238238

239-
If you are using the `Route::lobWebhooks` macro, you can append the `configKey` as follows (assuming your incoming route url is `lob-webhook-url`):
239+
If you are using the `Route::lobWebhooks` macro, you can append the `configKey` as follows (assuming your incoming route url is `webhooks/lob`):
240240

241241
```php
242-
Route::lobWebhooks('lob-webhook-url/{configKey}');
242+
Route::lobWebhooks('webhooks/lob/{configKey}');
243243
```
244244

245245
Alternatively, if you are manually defining the route, you can add `configKey` like so:
246246

247247
```php
248-
Route::post('lob-webhook-url/{configKey}', 'BinaryCats\LobWebhooks\LobWebhooksController');
248+
Route::post('webhooks/lob/{configKey}', 'BinaryCats\LobWebhooks\LobWebhooksController');
249249
```
250250

251251
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 Lob.com posts to `lob-webhook-url/my-named-secret` you'd add a new config named `signing_secret_my-named-secret`.
252252

253253
Example config might look like:
254254

255255
```php
256-
// secret for when Lob.com posts to lob-webhook-url/account
256+
// secret for when Lob.com posts to webhooks/lob/account
257257
'signing_secret_account' => 'whsec_abc',
258-
// secret for when Lob.com posts to lob-webhook-url/connect
258+
// secret for when Lob.com posts to webhooks/lob/connect
259259
'signing_secret_connect' => 'whsec_123',
260260
```
261261

0 commit comments

Comments
 (0)