Laravel Notification doesn’t work when queued

I’m using notifications to send emails to the admin when a new note added by the user. If I don’t use the ShouldQueue, all work fine.. When I use queue I got an error

ErrorException: Undefined property: AppNotificationsNewKidNote::$note

what might be the reason?
here is my notification code


namespace AppNotifications;

use IlluminateBusQueueable;
use IlluminateContractsQueueShouldQueue;
use IlluminateNotificationsMessagesMailMessage;
use IlluminateNotificationsNotification;
use AppModelsKidNote;

class NewKidNote extends Notification
    use Queueable;

    protected $note;
    protected $kidname;
    protected $userfullname;
    protected $color;
    protected $sentnote;
    protected $kidid;

    public function __construct($note)
        $this->note          = $note;
        $this->kidname       = $note->kid->name;
        $this->userfullname  = $note->user->fullname;
        $this->color         = $note->color;
        $this->sentnote      = $note->note;
        $this->kidid         = $note->kid_id;

    public function via($notifiable)
        return ['mail','database'];

    public function toMail($notifiable)
        return (new MailMessage)
              ->subject('New Note added')
              ->greeting('Hello ')
              ->line('New Note has been added for '. $this->kidname. ' by '.$this->userfullname)
              ->line('Note Color: '.$this->color)
              ->action('You can also see the note here', route('',$this->kidid));
    public function toDatabase($notifiable)
        return [
           'icon'    => 'notepad',
           'color'   => $this->color,
           'message' => 'New note added for '. $this->kidname ,
           'link'    => route('',$this->kidid)


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Note to self.. Make sure you clean the cache and restart the queue :)) then it works fine!! This code runs perfectly. thanks

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x