Compare commits

...

2 Commits

Author SHA1 Message Date
e20caa54c7 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
2026-01-27 06:12:51 +00:00
dhanabalan
fd6149ccbe Added PushSubscription method in the user model
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Failing after 7m31s
Laravel Larastan / larastan (pull_request) Failing after 8m57s
2026-01-27 11:42:40 +05:30

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