Skip to content

Commit aaa0456

Browse files
authored
Merge pull request #4 from brunogaspar/fix/route-notification-for-issue-not-having-notification-passed
[Bug] Issue where the routeNotificationFor was not passing the instance of the Notification itself
2 parents c36f64b + e81bf73 commit aaa0456

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/SnsChannel.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(Sns $sns, Dispatcher $events)
3535
public function send($notifiable, Notification $notification)
3636
{
3737
try {
38-
$destination = $this->getDestination($notifiable);
38+
$destination = $this->getDestination($notifiable, $notification);
3939
$message = $this->getMessage($notifiable, $notification);
4040

4141
return $this->sns->send($message, $destination);
@@ -53,13 +53,14 @@ public function send($notifiable, Notification $notification)
5353
/**
5454
* Get the phone number to send a notification to.
5555
*
56-
* @param $notifiable
56+
* @param mixed $notifiable
57+
* @param \Illuminate\Notifications\Notification $notification
5758
* @return mixed
5859
* @throws CouldNotSendNotification
5960
*/
60-
protected function getDestination($notifiable)
61+
protected function getDestination($notifiable, Notification $notification)
6162
{
62-
if ($to = $notifiable->routeNotificationFor('sns')) {
63+
if ($to = $notifiable->routeNotificationFor('sns', $notification)) {
6364
return $to;
6465
}
6566

@@ -69,7 +70,7 @@ protected function getDestination($notifiable)
6970
/**
7071
* Try to get the phone number from some commonly used attributes for that.
7172
*
72-
* @param $notifiable
73+
* @param mixed $notifiable
7374
* @return mixed
7475
* @throws CouldNotSendNotification
7576
*/

0 commit comments

Comments
 (0)