Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Support delaying notifications per channel #35273

merged 1 commit into from Nov 19, 2020

[8.x] Support delaying notifications per channel #35273

merged 1 commit into from Nov 19, 2020


Copy link

@iamgergo iamgergo commented Nov 18, 2020

Recently I faced the situation, I had to delay the same notification differently on database/email/sms channels.

Currently, there is no easy way to do that, however, we could solve this quite simply. This is a working, but rather conceptional PR, if you find this approach useful, we might polish it further, refactor a bit, update the docblocks, maybe extract the channel delay to its own method, adding tests and so on.

    (new NewOrder(Order::first()))->delay([
        'mail' => now()->addDay(),
        'sms' => 300,
  • This would not be a breaking change – as far as I know
  • If a channel is not present in the delayed values it won't be delayed
  • If the value is not an array, the given delay will be used by all channels (like now)

@taylorotwell taylorotwell merged commit 664e87f into laravel:8.x Nov 19, 2020
13 checks passed
Copy link

@taylorotwell taylorotwell commented Nov 19, 2020

Thank you. Can you send a PR to the documentation?

Copy link
Contributor Author

@iamgergo iamgergo commented Nov 19, 2020

Yes, I'll send it soon. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants