From fd6149ccbe52deb44938a215568a0713a8c6c20e Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 27 Jan 2026 11:42:40 +0530 Subject: [PATCH] Added PushSubscription method in the user model --- app/Models/User.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index 0dbf673..1032e6f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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'); + } }