Merge pull request 'Added PushSubscription method in the user model' (#140) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #140
This commit was merged in pull request #140.
This commit is contained in:
2026-01-27 06:12:51 +00:00

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');
}
}