File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/Sentry/Laravel/Features Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,22 @@ public function handleNotificationSent(NotificationSent $event): void
7676 }
7777 }
7878
79- private function formatNotifiable (object $ notifiable ): string
79+ private function formatNotifiable ($ notifiable ): string
8080 {
81- $ notifiable = get_class ($ notifiable );
81+ 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+ }
8291
83- if ($ notifiable instanceof Model) {
84- $ notifiable .= "( {$ notifiable ->getKey ()}) " ;
92+ return $ result ;
8593 }
8694
87- return $ notifiable ;
95+ return ' unknown ' ;
8896 }
8997}
You can’t perform that action at this time.
0 commit comments