Passed
Push — master ( e93e93...d5d16d )
by John
02:31
created
src/Services/InboxService.php 1 patch
Braces   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,12 +50,10 @@  discard block
 block discarded – undo
50 50
                 $message->conversation_id = $conversation->id;
51 51
                 $message->save();
52 52
                 return redirect()->to(url('/').'/conversation/'.$conversation->id)->send();
53
-            }
54
-        else{
53
+            } else{
55 54
                 return redirect()->back()->withErrors('Conversation already exists')->send();
56 55
         }
57
-        }
58
-        else{
56
+        } else{
59 57
          return redirect()->back()->withErrors('User not found')->send();
60 58
         }
61 59
     }
@@ -80,9 +78,9 @@  discard block
 block discarded – undo
80 78
                 foreach ($thread as $conversation){
81 79
                     if( auth()->id() == $conversation->id_to) {
82 80
                         $users[] = \Evilnet\Inbox\User::where('id', $conversation->id_from)->first();
81
+                    } elseif(auth()->id() == $conversation->id_from) {
82
+                                            $users[] = \Evilnet\Inbox\User::where('id', $conversation->id_to)->first();
83 83
                     }
84
-                    elseif(auth()->id() == $conversation->id_from)
85
-                        $users[] = \Evilnet\Inbox\User::where('id', $conversation->id_to)->first();
86 84
                 }
87 85
             }
88 86
             return $users;
Please login to merge, or discard this patch.