From eb37c62f99f4b2c3d1c62eed03f64c25e220d541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20D=2E=20Nagy?= Date: Thu, 19 Nov 2020 16:34:09 +0100 Subject: [PATCH] [8.x] Add docs for per channel delay (#6581) * [8.x] Add docs for per channel delay * Update notifications.md Co-authored-by: Taylor Otwell --- notifications.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/notifications.md b/notifications.md index 9d0a507e27..6d51ce676c 100644 --- a/notifications.md +++ b/notifications.md @@ -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), + ])); #### Customizing Notification Channel Queues