Skip to content

Error: Call to a member function create() on string in file vendor\laravel\framework\src\Illuminate\Notifications\Channels\DatabaseChannel.php on line 19 #75

@mhdEurFlash123

Description

@mhdEurFlash123

When adding this function to User model as descriped in your documentation here

   public function routeNotificationFor($channel)
{
    if($channel === 'PusherPushNotifications'){
        return 'your.custom.interest.string';
    }

    $class = str_replace('\\', '.', get_class($this));

    return $class.'.'.$this->getKey();
}

the error above comes by 😑

and this is my via method in my notification

 public function via($notifiable)
    {
        return [PusherChannel::class , 'database'];
    }
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions