Passed
Push — dev5a ( 2c238c...96dd50 )
by Ron
07:38
created
app/Domains/TechTips/SearchTips.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
     //  Process all of the search filters to search for a tech tip
43 43
     protected function searchFor($search)
44 44
     {
45
-        $searchText = isset($search['text'])   ? explode(' ', $search['text']) : null;
46
-        $type       = isset($search['type'])   ? $search['type'] : null;
45
+        $searchText = isset($search['text']) ? explode(' ', $search['text']) : null;
46
+        $type       = isset($search['type']) ? $search['type'] : null;
47 47
         $sys        = isset($search['sys_id']) ? $search['sys_id'] : null;
48 48
 
49 49
         return TechTips::orderBy('sticky', 'DESC')
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
         return TechTips::orderBy('sticky', 'DESC')
50 50
             ->orderBy('created_at', 'DESC')
51 51
             //  Search text fields
52
-            ->when(!empty($searchText), function($q) use ($searchText)
53
-            {
52
+            ->when(!empty($searchText), function($q) use ($searchText) {
54 53
                 foreach($searchText as $text)
55 54
                 {
56 55
                     $q->orWhere('subject', 'like', '%'.$text.'%')
@@ -59,15 +58,12 @@  discard block
 block discarded – undo
59 58
                 }
60 59
             })
61 60
             //  Search Article Type fields
62
-            ->when($type, function($q) use ($type)
63
-            {
61
+            ->when($type, function($q) use ($type) {
64 62
                 $q->whereIn('tip_type_id', $type);
65 63
             })
66 64
             //  Search equipment type fields
67
-            ->when($sys, function($q) use ($sys)
68
-            {
69
-                $q->whereHas('SystemTypes', function($q2) use ($sys)
70
-                {
65
+            ->when($sys, function($q) use ($sys) {
66
+                $q->whereHas('SystemTypes', function($q2) use ($sys) {
71 67
                     $q2->whereIn('system_types.sys_id', $sys);
72 68
                 });
73 69
             })
Please login to merge, or discard this patch.