Added PushSubscription method in the user model #140

Merged
jothi merged 1 commits from ranjith-dev into master 2026-01-27 06:12:51 +00:00
Showing only changes of commit fd6149ccbe - Show all commits

View File

@@ -14,6 +14,7 @@ use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use NotificationChannels\WebPush\HasPushSubscriptions;
use NotificationChannels\WebPush\PushSubscription;
class User extends Authenticatable implements FilamentUser
{
@@ -64,4 +65,9 @@ class User extends Authenticatable implements FilamentUser
{
return $this->belongsTo(Plant::class);
}
public function pushSubscriptions()
{
return $this->morphMany(PushSubscription::class, 'subscribable');
}
}