We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9b7166 commit 5f48872Copy full SHA for 5f48872
src/Sentry/Laravel/Features/NotificationsIntegration.php
@@ -76,14 +76,22 @@ public function handleNotificationSent(NotificationSent $event): void
76
}
77
78
79
- private function formatNotifiable(object $notifiable): string
+ private function formatNotifiable($notifiable): string
80
{
81
- $notifiable = get_class($notifiable);
+ if (is_string($notifiable) || is_numeric($notifiable)) {
82
+ return (string)$notifiable;
83
+ }
84
+
85
+ if (is_object($notifiable)) {
86
+ $result = get_class($notifiable);
87
88
+ if ($notifiable instanceof Model) {
89
+ $result .= "({$notifiable->getKey()})";
90
91
- if ($notifiable instanceof Model) {
- $notifiable .= "({$notifiable->getKey()})";
92
+ return $result;
93
94
- return $notifiable;
95
+ return 'unknown';
96
97
0 commit comments