Skip to content

Commit

Permalink
Merge pull request #13 from ClintWinter/master
Browse files Browse the repository at this point in the history
Add `model` relationship to `HasNotificationSubscriptions`
  • Loading branch information
liran-co authored May 28, 2021
2 parents b160476 + 6a684a7 commit 16f9f7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Traits/HasNotificationSubscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public function notificationSubscriptions()
return $this->morphMany(NotificationSubscription::class, 'notifiable');
}

public function model()
{
return $this->morphMany(NotificationSubscription::class, 'model');
}

public function subscribe($type, $channel = '*', $model = null)
{
$subscription = $this->findSubscription($type, $channel, $model);
Expand Down

0 comments on commit 16f9f7d

Please sign in to comment.