Completed
Push — master ( bf62da...395a1a )
by Christopher
02:52
created
src/Traits/Friendable.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function befriend(Model $recipient)
17 17
     {
18
-        if (! $this->canBefriend($recipient)) {
18
+        if (!$this->canBefriend($recipient)) {
19 19
             return false;
20 20
         }
21 21
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         //If sender has a friendship with the recipient return false
244 244
         if ($friendship = $this->getFriendship($recipient)) {
245 245
             //if previous friendship was Denied then let the user send fr
246
-            if (! $friendship->status == Status::DENIED) {
246
+            if (!$friendship->status == Status::DENIED) {
247 247
                 return false;
248 248
             }
249 249
         }
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
     private function findFriendships($status = '%')
270 270
     {
271 271
         return Friendship::where('status', 'LIKE', $status)
272
-            ->where(function ($query) {
273
-                $query->where(function ($q) {
272
+            ->where(function($query) {
273
+                $query->where(function($q) {
274 274
                     $q->whereSender($this);
275
-                })->orWhere(function ($q) {
275
+                })->orWhere(function($q) {
276 276
                     $q->whereRecipient($this);
277 277
                 });
278 278
             });
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
         $friendIds = array_unique(array_merge($recipients, $senders));
307 307
 
308 308
         $fofs = Friendship::where('status', Status::ACCEPTED)
309
-                          ->where(function ($query) use ($friendIds) {
310
-                              $query->where(function ($q) use ($friendIds) {
309
+                          ->where(function($query) use ($friendIds) {
310
+                              $query->where(function($q) use ($friendIds) {
311 311
                                   $q->whereIn('sender_id', $friendIds);
312
-                              })->orWhere(function ($q) use ($friendIds) {
312
+                              })->orWhere(function($q) use ($friendIds) {
313 313
                                   $q->whereIn('recipient_id', $friendIds);
314 314
                               });
315 315
                           })->get(['sender_id', 'recipient_id']);
Please login to merge, or discard this patch.