Explorar el Código

Update Api RelationshipTransformer

Daniel Supernault hace 5 años
padre
commit
16b426ec1e
Se han modificado 1 ficheros con 3 adiciones y 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) {