File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace Undjike \CamooNotificationChannel ;
44
5+ use Illuminate \Notifications \AnonymousNotifiable ;
56use Illuminate \Notifications \Notification ;
67use Undjike \CamooNotificationChannel \Exceptions \CouldNotSendNotification ;
78use Undjike \CamooNotificationChannel \Requests \SendMessageRequest ;
@@ -19,9 +20,11 @@ class CamooChannel
1920 */
2021 public function send ($ notifiable , Notification $ notification ): mixed
2122 {
22- $ recipient = is_string ($ notifiable )
23- ? $ notifiable
24- : $ notifiable ->routeNotificationFor ('Camoo ' );
23+ $ recipient = match (true ) {
24+ is_string ($ notifiable ) => $ notifiable ,
25+ $ notifiable instanceof AnonymousNotifiable => $ notifiable ->routeNotificationFor (__CLASS__ ),
26+ default => $ notifiable ->routeNotificationFor ('Camoo ' )
27+ };
2528
2629 if (! $ recipient ) {
2730 throw CouldNotSendNotification::camooRespondedWithAnError (
You can’t perform that action at this time.
0 commit comments