Browse Source

Update Api RelationshipTransformer

Daniel Supernault 5 năm trước cách đây
mục cha
commit
16b426ec1e
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      app/Transformer/Api/RelationshipTransformer.php

+ 3 - 0
app/Transformer/Api/RelationshipTransformer.php

@@ -14,6 +14,9 @@ class RelationshipTransformer extends Fractal\TransformerAbstract
     public function transform(Profile $profile)
     {
         $auth = Auth::check();
+        if(!$auth) {
+            return [];
+        }
         $user = $auth ? Auth::user()->profile : false;
         $requested = false;
         if($user) {