2024-02-26 15:04:47 +01:00
< ? php
namespace App\Listeners ;
use Illuminate\Notifications\Events\NotificationSent ;
use Illuminate\Support\Facades\Log ;
2024-06-28 16:13:45 +02:00
class LogNotificationListener
2024-02-26 15:04:47 +01:00
{
/**
* Create the event listener .
*
* @ return void
*/
public function __construct ()
{
//
}
/**
* Handle the event .
*
* @ return void
*/
public function handle ( NotificationSent $event )
{
// $event->channel
// $event->notifiable
// $event->notification
// $event->response
Log :: info ( sprintf ( 'Notification of type %s sent via channel %s to user ID #%s' , get_class ( $event -> notification ), $event -> channel , $event -> notifiable -> id ));
}
}