Passed
Push — master ( e93e93...d5d16d )
by John
02:31
created
src/InboxController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
     {
25 25
         $conversations = $this->inboxService->fetchAllConversation();
26 26
 
27
-      $users = $this->inboxService->getInboxUsers($conversations);
27
+        $users = $this->inboxService->getInboxUsers($conversations);
28 28
 
29 29
 
30
-     return view('inbox::inbox.index', compact('conversations', 'users'));
30
+        return view('inbox::inbox.index', compact('conversations', 'users'));
31 31
     }
32 32
     /**
33 33
      * Show the form for creating a new resource.
Please login to merge, or discard this patch.
src/Repository/InboxRepository.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 class InboxRepository
16 16
 {
17
-	public function fetchAll()
17
+    public function fetchAll()
18 18
     {
19 19
         return Conversation::where('id_from', auth()->id())->orderBy('id', 'desc')->orWhere('id_to', auth()->id())->orderBy('id', 'desc')->get()->groupBy(function ($data){
20 20
             return Carbon::parse($data->created_at)->format('Y-m-d');
Please login to merge, or discard this patch.
src/InboxServiceProvider.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function boot()
15 15
     {
16 16
         include __DIR__.'/routes.php';
17
-          $this->publishes([
17
+            $this->publishes([
18 18
             __DIR__ . '/migrations' => $this->app->databasePath() . '/migrations'
19 19
         ], 'migrations');
20 20
 
Please login to merge, or discard this patch.
src/Services/InboxService.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $a->message = $request->get('message');
31 31
         $a->conversation_id = $request->get('conv_id');
32 32
         $a->save();
33
-         return redirect()->back()->send();
33
+            return redirect()->back()->send();
34 34
     }
35 35
 
36 36
     public function addConversation($user,$messg,$subject){
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
         }
58 58
         else{
59
-         return redirect()->back()->withErrors('User not found')->send();
59
+            return redirect()->back()->withErrors('User not found')->send();
60 60
         }
61 61
     }
62 62
     public  function fetchAllConversation(){
Please login to merge, or discard this 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.