Explorar o código

Update Api RelationshipTransformer

Daniel Supernault %!s(int64=5) %!d(string=hai) anos
pai
achega
16b426ec1e
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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) {