kshitizmittal
8 months ago

Database Notification Laravel 5.6

Posted 8 months ago by kshitizmittal

Trying to send database notification,

Route::get('/notify',function(){
    // $when = Carbon::now()->addseconds(10); 
    $user = Employeedetail::where('emp_id','710101')->first(); 
    // dd($user);
    $user->notify(new LeaveNotification);

    dd('sent');
});

Error Message :-

"Call to undefined method App\Employeedetail::notify()"

This is working fine with User::notify();

But I want to send notifiable type as App\Employeedetail in database and notifiable id as 7101401 which is employee ID in Employeedetail model and primary key as well.

Please sign in or create an account to participate in this conversation.