zhaogood's avatar

How to get the notification instance after it's sent?

Hi,

I would like to do something extra after sending notification. If I use Notifiable trait send notification, how do I get the notification instance?

The notify function doesn't return anything $user->notify(new InvoicePaid($invoice));

Does anyone know how to do it? Thanks!

0 likes
3 replies
Snapey's avatar

I assume you cant get what you need from your invoice paid class?

zhaogood's avatar

Thanks Snapey, even I create an new object,

$instance = new InvoicePaid($invoice);
$user->notify($instance);

The $instance->id is still null.

Snapey's avatar

perhaps listen for one of

Illuminate\Notifications\Events\NotificationSending
Illuminate\Notifications\Events\NotificationSent

Please or to participate in this conversation.