Test Setup Failed
Push — dev6 ( 81193f...01d104 )
by Ron
22:34
created
app/Policies/CustomerPolicy.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function create(User $user)
44 44
     {
45
-        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q)
46
-        {
45
+        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) {
47 46
             $q->where('description', 'Add Customer');
48 47
         })->first();
49 48
 
@@ -64,8 +63,7 @@  discard block
 block discarded – undo
64 63
      */
65 64
     public function update(User $user, Customer $customer)
66 65
     {
67
-        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q)
68
-        {
66
+        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) {
69 67
             $q->where('description', 'Update Customer');
70 68
         })->first();
71 69
 
Please login to merge, or discard this patch.
app/Policies/UserPolicy.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     */
18 18
     public function before(User $user, $method)
19 19
     {
20
-        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q)
21
-        {
20
+        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) {
22 21
             $q->where('description', 'Manage Users');
23 22
         })->first();
24 23
 
Please login to merge, or discard this patch.
app/Policies/EquipmentTypePolicy.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     */
18 18
     public function before(User $user, $method)
19 19
     {
20
-        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q)
21
-        {
20
+        $allowed = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) {
22 21
             $q->where('description', 'Manage Equipment');
23 22
         })->first();
24 23
 
Please login to merge, or discard this patch.
app/Http/Requests/User/InitializeUserRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     public function rules()
21 21
     {
22 22
         return [
23
-            'email'    => 'required|exists:users',              //  Must be a valid email address
23
+            'email'    => 'required|exists:users', //  Must be a valid email address
24 24
             'password' => 'required|string|min:6|confirmed',
25 25
         ];
26 26
     }
Please login to merge, or discard this patch.
app/Http/Requests/Equipment/EquipmentTypeRequest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@
 block discarded – undo
22 22
     public function rules()
23 23
     {
24 24
         return [
25
-            'cat_id' => 'required|exists:equipment_categories,name',        //  Must contain a valid Category ID
25
+            'cat_id' => 'required|exists:equipment_categories,name', //  Must contain a valid Category ID
26 26
             'name'   => [
27 27
                 'required',
28 28
                 'string',
29
-                'regex:/^[a-zA-Z0-9_ ]*$/',                                 //  No special characters are allowed
30
-                'unique:equipment_categories',                              //  Equipment with this name must not already exist
29
+                'regex:/^[a-zA-Z0-9_ ]*$/', //  No special characters are allowed
30
+                'unique:equipment_categories', //  Equipment with this name must not already exist
31 31
             ],
32 32
             'data_fields' => 'required|array',
33 33
         ];
Please login to merge, or discard this patch.
app/Http/Requests/Equipment/EquipmentCategoryRequest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
             'name' => [
26 26
                 'required',
27 27
                 'string',
28
-                'regex:/^[a-zA-Z0-9_ ]*$/',     //  No special characters are allowed
29
-                'unique:equipment_categories',  //  Category name must not already exist
28
+                'regex:/^[a-zA-Z0-9_ ]*$/', //  No special characters are allowed
29
+                'unique:equipment_categories', //  Category name must not already exist
30 30
             ]
31 31
         ];
32 32
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Customers/CustomerController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         Log::channel('cust')->info('New Customer - '.$request->name.' created by '.Auth::user()->full_name);
49 49
 
50
-        return redirect(route('customers.show',$newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']);
50
+        return redirect(route('customers.show', $newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']);
51 51
     }
52 52
 
53 53
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                         // ->with('ParentContact.CustomerContactPhone.PhoneNumberType')
73 73
                         ->with('CustomerNote')
74 74
                         ->firstOrFail();
75
-        $isFav    = UserCustomerBookmark::where('user_id', Auth::user()->user_id)
75
+        $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id)
76 76
                         ->where('cust_id', $customer->cust_id)
77 77
                         ->count();
78 78
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
             'details'        => $customer,
81 81
             'phone_types'    => PhoneNumberType::all(),
82 82
             'user_functions' => [
83
-                'fav'  => $isFav,                                           //  Customer is bookmarked by the user
84
-                'edit' => Auth::user()->can('update', $customer),           //  User is allowed to edit the customers basic details
83
+                'fav'  => $isFav, //  Customer is bookmarked by the user
84
+                'edit' => Auth::user()->can('update', $customer), //  User is allowed to edit the customers basic details
85 85
             ],
86 86
         ]);
87 87
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Customers/CustomerSearchController.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
             ($request->city == null &&
30 30
              $request->name == null &&
31 31
              $request->equipment == null)
32
-            )
33
-        {
32
+            ) {
34 33
             return $this->getAllCustomers();
35 34
         }
36 35
 
@@ -45,25 +44,20 @@  discard block
 block discarded – undo
45 44
     {
46 45
         return Customer::orderBy($this->sortField, $this->sortType)
47 46
             //  Search by equipment
48
-            ->when(isset($params['equipment']), function($q) use ($params)
49
-            {
50
-                $q->whereHas('ParentEquipment', function($q2) use ($params)
51
-                {
47
+            ->when(isset($params['equipment']), function($q) use ($params) {
48
+                $q->whereHas('ParentEquipment', function($q2) use ($params) {
52 49
                     $q2->where('name', $params['equipment']);
53 50
                 })
54
-                ->orWhereHas('EquipmentType', function($q2) use ($params)
55
-                {
51
+                ->orWhereHas('EquipmentType', function($q2) use ($params) {
56 52
                     $q2->where('name', $params['equipment']);
57 53
                 });
58 54
             })
59 55
             //  Search by City
60
-            ->when(isset($params['city']), function($q) use ($params)
61
-            {
56
+            ->when(isset($params['city']), function($q) use ($params) {
62 57
                 $q->where('city', 'like', '%'.$params['city'].'%');
63 58
             })
64 59
             //  Search by Name or ID
65
-            ->when(isset($params['name']), function($q) use ($params)
66
-            {
60
+            ->when(isset($params['name']), function($q) use ($params) {
67 61
                 $q->where('name', 'like', '%'.$params['name'].'%')
68 62
                     ->orWhere('cust_id', 'like', '%'.$params['name'].'%')
69 63
                     ->orWhere('dba_name', 'like', '%'.$params['name'].'%');
Please login to merge, or discard this patch.
app/Http/Controllers/Customers/CustomerBookmarksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,6 +27,6 @@
 block discarded – undo
27 27
             UserCustomerBookmark::where('user_id', Auth::user()->user_id)->where('cust_id', $request->cust_id)->first()->delete();
28 28
         }
29 29
 
30
-        return response()->noContent();              //->json(['success' => true]);
30
+        return response()->noContent(); //->json(['success' => true]);
31 31
     }
32 32
 }
Please login to merge, or discard this patch.