Skip to content

Commit

Permalink
[8.x] Add docs for per channel delay (#6581)
Browse files Browse the repository at this point in the history
* [8.x] Add docs for per channel delay

* Update notifications.md

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
iamgergo and taylorotwell committed Nov 19, 2020
1 parent 810f753 commit eb37c62
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions notifications.md
Expand Up @@ -144,9 +144,16 @@ Once the `ShouldQueue` interface has been added to your notification, you may se

If you would like to delay the delivery of the notification, you may chain the `delay` method onto your notification instantiation:

$when = now()->addMinutes(10);
$delay = now()->addMinutes(10);

$user->notify((new InvoicePaid($invoice))->delay($when));
$user->notify((new InvoicePaid($invoice))->delay($delay));

You may pass an array to the `delay` method to specify the delay amount for specific channels:

$user->notify((new InvoicePaid($invoice))->delay([
'mail' => now()->addMinutes(5),
'sms' => now()->addMinutes(10),
]));

<a name="customizing-notification-channel-queues"></a>
#### Customizing Notification Channel Queues
Expand Down

0 comments on commit eb37c62

Please sign in to comment.