Passed
Push — dev5a ( bf2271...c9bcfe )
by Ron
08:07
created
app/Domains/Customers/CustomerSearch.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,13 +85,13 @@
 block discarded – undo
85 85
             ->when(isset($searchData->name), function($q) use ($searchData)
86 86
             {
87 87
                 $q->where('name', 'like', '%'.$searchData->name.'%')
88
-                  ->orWhere('cust_id', 'like', '%'.$searchData->name.'%')
89
-                  ->orWhere('dba_name', 'like', '%'.$searchData->name.'%');
88
+                    ->orWhere('cust_id', 'like', '%'.$searchData->name.'%')
89
+                    ->orWhere('dba_name', 'like', '%'.$searchData->name.'%');
90 90
             })
91 91
             ->when($includeSystems, function($q)
92 92
             {
93 93
                 $q->with('CustomerSystems.SystemTypes')
94
-                  ->with('ParentSystems.SystemTypes');
94
+                    ->with('ParentSystems.SystemTypes');
95 95
             })
96 96
             ->paginate($pagination->perPage);
97 97
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         $pagination = $this->getPagination($request);
17 17
         $sort       = $this->getSortFields($request);
18 18
 
19
-        if((array)$searchData)
19
+        if((array) $searchData)
20 20
         {
21 21
             $results = $this->searchFor($searchData, $pagination, $sort, true);
22 22
         }
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
             //  Search equipment field
68 68
             ->when(isset($searchData->equipment), function($q) use ($searchData)
69 69
             {
70
-                $q->whereHas('ParentSystems.SystemTypes', function ($qry) use ($searchData)
70
+                $q->whereHas('ParentSystems.SystemTypes', function($qry) use ($searchData)
71 71
                 {
72 72
                     $qry->where('sys_id', $searchData->equipment);
73 73
                 })
74
-                ->orWhereHas('CustomerSystems.SystemTypes', function ($qry) use ($searchData)
74
+                ->orWhereHas('CustomerSystems.SystemTypes', function($qry) use ($searchData)
75 75
                 {
76 76
                     $qry->where('sys_id', $searchData->equipment);
77 77
                 });
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,31 +65,25 @@  discard block
 block discarded – undo
65 65
     {
66 66
         return Customers::orderBy($sort->sortField, $sort->sortType)
67 67
             //  Search equipment field
68
-            ->when(isset($searchData->equipment), function($q) use ($searchData)
69
-            {
70
-                $q->whereHas('ParentSystems.SystemTypes', function ($qry) use ($searchData)
71
-                {
68
+            ->when(isset($searchData->equipment), function($q) use ($searchData) {
69
+                $q->whereHas('ParentSystems.SystemTypes', function ($qry) use ($searchData) {
72 70
                     $qry->where('sys_id', $searchData->equipment);
73 71
                 })
74
-                ->orWhereHas('CustomerSystems.SystemTypes', function ($qry) use ($searchData)
75
-                {
72
+                ->orWhereHas('CustomerSystems.SystemTypes', function ($qry) use ($searchData) {
76 73
                     $qry->where('sys_id', $searchData->equipment);
77 74
                 });
78 75
             })
79 76
             //  Search city field
80
-            ->when(isset($searchData->city), function($q) use ($searchData)
81
-            {
77
+            ->when(isset($searchData->city), function($q) use ($searchData) {
82 78
                 $q->where('city', 'like', '%'.$searchData->city.'%');
83 79
             })
84 80
             //  Search name field
85
-            ->when(isset($searchData->name), function($q) use ($searchData)
86
-            {
81
+            ->when(isset($searchData->name), function($q) use ($searchData) {
87 82
                 $q->where('name', 'like', '%'.$searchData->name.'%')
88 83
                   ->orWhere('cust_id', 'like', '%'.$searchData->name.'%')
89 84
                   ->orWhere('dba_name', 'like', '%'.$searchData->name.'%');
90 85
             })
91
-            ->when($includeSystems, function($q)
92
-            {
86
+            ->when($includeSystems, function($q) {
93 87
                 $q->with('CustomerSystems.SystemTypes')
94 88
                   ->with('ParentSystems.SystemTypes');
95 89
             })
@@ -100,8 +94,7 @@  discard block
 block discarded – undo
100 94
     protected function getAllCustomers($pagination, $sort, $includeSystems = false)
101 95
     {
102 96
         return Customers::orderBy($sort->sortField, $sort->sortType)
103
-            ->when($includeSystems, function($q)
104
-            {
97
+            ->when($includeSystems, function($q) {
105 98
                 $q->with('CustomerSystems.SystemTypes')
106 99
                 ->with('ParentSystems.SystemTypes');
107 100
             })
Please login to merge, or discard this patch.