laravel-notification-channels / webpush

Webpush notifications channel for Laravel.
http://laravel-notification-channels.com
MIT License
681 stars 119 forks source link

Call to a member function isEmpty() null #154

Closed Rakesh2907 closed 2 years ago

Rakesh2907 commented 3 years ago

Hello,

When set Notification::send(User::all(),new PushDemo); in my controller getting following error

Call to a member function isEmpty() on null at D:\xampp\htdocs\XXXXXX\vendor\laravel-notification-channels\webpush\src\WebPushChannel.php:44)

Please help me.

jhenrich commented 3 years ago

Came across the same error. Adding the HasPushSubscriptions using on my user model fixed it for me class User extends Authenticatable implements JWTSubject { use HasFactory, Notifiable, HasPushSubscriptions;

kirkbushell commented 3 years ago

I'm curious how to do this when your subscribers don't have user models. Ie. They've subscribed via the browser notice, but don't have a user account.

asterism612 commented 1 year ago

I have same error . How to solve this problem?