Selaa lähdekoodia

Update Profile model

Daniel Supernault 6 vuotta sitten
vanhempi
commit
908740b46f
1 muutettua tiedostoa jossa 14 lisäystä ja 4 poistoa
  1. 14 4
      app/Profile.php

+ 14 - 4
app/Profile.php

@@ -275,10 +275,20 @@ class Profile extends Model
                     ]
                 ];
                 break;
-            
-            default:
-                # code...
-                break;
         }
+        return $audience;
+    }
+
+    public function getAudienceInbox($scope = 'public')
+    {
+        return $this
+            ->followers()
+            ->whereLocalProfile(false)
+            ->get()
+            ->map(function($follow) {
+                return $follow->sharedInbox ?? $follow->inbox_url;
+             })
+            ->unique()
+            ->toArray();
     }
 }