1

I'm building a SAAS and I want each tenant to have their own queue for notifications. I have a notification class that implements Illuminate\Contracts\Queue\ShouldQueue and I send the notification like this

$user->notify($notification);

But I haven't found a way to specify the queue that I want the notification to be pushed to. I know that jobs can be pushed to specific queues with onQueue:

ProcessPodcast::dispatch($podcast)->onQueue('tenant1');

But is it possible to do something like this for queueable notifications as well?

1 Answer 1

2

Since your notification should use the Illuminate\Bus\Queueable trait you can simply set the $queue property of the object. There's a helper function for it:

$notification->onQueue('tenant1');
$user->notify($notification);
Sign up to request clarification or add additional context in comments.

1 Comment

Awesome! That's simple enough. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.