Passed
Push — dev5a ( bf2271...c9bcfe )
by Ron
08:07
created
app/Domains/Customers/CustomerSearch.php 1 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.