Passed
Push — dev5 ( f1e67f...73d054 )
by Ron
06:18
created
app/Http/Controllers/Customers/CustomerController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@
 block discarded – undo
49 49
                     //  Search the name, dba name, and cust id columns
50 50
                     ->where(function($query) use ($request)
51 51
                     {
52
-                        $query->where('name', 'like', '%' . $request->name . '%')
53
-                            ->orWhere('cust_id', 'like', '%' . $request->name . '%')
54
-                            ->orWhere('dba_name', 'like', '%' . $request->name . '%');
52
+                        $query->where('name', 'like', '%'.$request->name.'%')
53
+                            ->orWhere('cust_id', 'like', '%'.$request->name.'%')
54
+                            ->orWhere('dba_name', 'like', '%'.$request->name.'%');
55 55
                     })
56 56
                     //  Search the city column
57
-                    ->where('city', 'like', '%' . $request->city . '%')
57
+                    ->where('city', 'like', '%'.$request->city.'%')
58 58
                     //  Include the customers systems
59 59
                     ->with('CustomerSystems.SystemTypes')
60 60
                     //  If the system field is present - search for system type
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
             $searchResults = new CustomersCollection(
48 48
                 Customers::orderBy($request->sortField, $request->sortType)
49 49
                     //  Search the name, dba name, and cust id columns
50
-                    ->where(function($query) use ($request)
51
-                    {
50
+                    ->where(function($query) use ($request) {
52 51
                         $query->where('name', 'like', '%' . $request->name . '%')
53 52
                             ->orWhere('cust_id', 'like', '%' . $request->name . '%')
54 53
                             ->orWhere('dba_name', 'like', '%' . $request->name . '%');
@@ -58,10 +57,8 @@  discard block
 block discarded – undo
58 57
                     //  Include the customers systems
59 58
                     ->with('CustomerSystems.SystemTypes')
60 59
                     //  If the system field is present - search for system type
61
-                    ->when($request->system, function($query) use ($request)
62
-                    {
63
-                        $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request)
64
-                        {
60
+                    ->when($request->system, function($query) use ($request) {
61
+                        $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) {
65 62
                             $query->where('sys_id', $request->system);
66 63
                         });
67 64
                     })
Please login to merge, or discard this patch.
database/factories/Customers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\Customers;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(Customers::class, function (Faker $faker) {
8
+$factory->define(Customers::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
         'cust_id'  => $faker->unique()->numberBetween(50, 10000),
Please login to merge, or discard this patch.
database/factories/SystemTypesFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\SystemTypes;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(SystemTypes::class, function (Faker $faker) {
8
+$factory->define(SystemTypes::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
         'cat_id' => factory(App\SystemCategories::class)->create()->cat_id,
Please login to merge, or discard this patch.
database/factories/SystemCategoriesFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use App\SystemCategories;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(SystemCategories::class, function (Faker $faker) {
8
+$factory->define(SystemCategories::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
         'name' => $faker->text(15)
Please login to merge, or discard this patch.