Passed
Push — develop ( 62f833...95decf )
by Septianata
11:22
created
app/Http/Requests/Auth/RegisterRequest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@
 block discarded – undo
18 18
     public static function getRules()
19 19
     {
20 20
         return [
21
-            'branch_name' => 'required|exists:' . Branch::class . ',name',
22
-            'username' => 'required|string|max:255|unique:' . User::class,
21
+            'branch_name' => 'required|exists:'.Branch::class.',name',
22
+            'username' => 'required|string|max:255|unique:'.User::class,
23 23
             'fullname' => 'required|string|max:255',
24
-            'gender' => 'sometimes|nullable|enum:' . Gender::class,
25
-            'email' => 'required|string|email|max:255|unique:' . User::class,
24
+            'gender' => 'sometimes|nullable|enum:'.Gender::class,
25
+            'email' => 'required|string|email|max:255|unique:'.User::class,
26 26
             'phone_country' => 'sometimes|in:ID',
27
-            'phone' => ['required', 'string', 'phone:ID', function ($attribute, $phone, $fail) {
27
+            'phone' => [ 'required', 'string', 'phone:ID', function($attribute, $phone, $fail) {
28 28
                 $user = User::where('phone', PhoneNumber::make($phone, request()->input('phone_country', env('PHONE_COUNTRY', 'ID')))->formatE164())->count();
29 29
 
30 30
                 if ($user > 0) {
31
-                    $fail(trans('validation.unique', ['attribute' => static::getAttributes()[$attribute]]));
31
+                    $fail(trans('validation.unique', [ 'attribute' => static::getAttributes()[ $attribute ] ]));
32 32
                 }
33
-            }],
34
-            'password' => ['required', 'confirmed', Rules\Password::defaults()],
33
+            } ],
34
+            'password' => [ 'required', 'confirmed', Rules\Password::defaults() ],
35 35
             'agree_with_terms' => 'required|boolean|in:1',
36 36
         ];
37 37
     }
Please login to merge, or discard this patch.
app/Http/Requests/Branch/StoreRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function rules()
22 22
     {
23 23
         return [
24
-            'name' => 'required|string|max:255|unique:' . Branch::class,
24
+            'name' => 'required|string|max:255|unique:'.Branch::class,
25 25
             'address' => 'required|string',
26 26
             'address_latitude' => 'required|numeric',
27 27
             'address_longitude' => 'required|numeric',
Please login to merge, or discard this patch.
app/Http/Requests/Configuration/StoreRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function rules()
23 23
     {
24 24
         return [
25
-            'key' => 'required|string|max:255|unique:' . Configuration::class,
25
+            'key' => 'required|string|max:255|unique:'.Configuration::class,
26 26
             'value' => 'required|string|max:255',
27 27
             'description' => 'sometimes|nullable|string',
28 28
         ];
Please login to merge, or discard this patch.
app/Http/Requests/Denomination/StoreRequest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
     {
24 24
         return [
25 25
             'name' => 'required|string|max:255',
26
-            'value' => 'required|numeric|min:0|unique:' . Denomination::class,
27
-            'type' => 'required|enum:' . DenominationType::class,
26
+            'value' => 'required|numeric|min:0|unique:'.Denomination::class,
27
+            'type' => 'required|enum:'.DenominationType::class,
28 28
             'quantity_per_bundle' => 'required|numeric|min:0',
29 29
             'minimum_order_bundle' => 'required|numeric|min:0',
30 30
             'maximum_order_bundle' => 'required|numeric|gte:minimum_order_bundle',
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         $file->storeAs(
66 66
             Denomination::IMAGE_PATH,
67
-            $filename = ($this->input('value') . '.' . $file->getClientOriginalExtension())
67
+            $filename = ($this->input('value').'.'.$file->getClientOriginalExtension())
68 68
         );
69 69
 
70 70
         return $filename;
Please login to merge, or discard this patch.
app/Http/Requests/Denomination/UpdateRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
     {
26 26
         return [
27 27
             'name' => 'required|string|max:255',
28
-            'value' => ['required', 'numeric', 'min:0', Rule::unique(Denomination::class)->ignoreModel($this->route('denomination'))],
29
-            'type' => 'required|enum:' . DenominationType::class,
28
+            'value' => [ 'required', 'numeric', 'min:0', Rule::unique(Denomination::class)->ignoreModel($this->route('denomination')) ],
29
+            'type' => 'required|enum:'.DenominationType::class,
30 30
             'quantity_per_bundle' => 'required|numeric|min:0',
31 31
             'minimum_order_bundle' => 'required|numeric|min:0',
32 32
             'maximum_order_bundle' => 'required|numeric|gte:minimum_order_bundle',
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
         $model = $this->route('denomination');
67 67
 
68 68
         if ($model->getRawOriginal('image') && $this->hasFile($key)) {
69
-            Storage::delete(Denomination::IMAGE_PATH . '/' . $model->getRawOriginal('image'));
69
+            Storage::delete(Denomination::IMAGE_PATH.'/'.$model->getRawOriginal('image'));
70 70
         }
71 71
 
72 72
         $file = $this->file($key);
73 73
 
74 74
         $file->storeAs(
75 75
             Denomination::IMAGE_PATH,
76
-            $filename = ($this->input('value') . '.' . $file->getClientOriginalExtension())
76
+            $filename = ($this->input('value').'.'.$file->getClientOriginalExtension())
77 77
         );
78 78
 
79 79
         return $filename;
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/CustomerController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function datatable()
33 33
     {
34 34
         return DataTables::eloquent(Customer::query())
35
-            ->setTransformer(fn ($model) => CustomerResource::make($model)->resolve())
35
+            ->setTransformer(fn($model) => CustomerResource::make($model)->resolve())
36 36
             ->toJson();
37 37
     }
38 38
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         return redirect()->route('admin.customer.index')->with([
67 67
             'alert' => [
68 68
                 'type' => 'alert-success',
69
-                'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.customer')]),
69
+                'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.customer') ]),
70 70
             ],
71 71
         ]);
72 72
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         return redirect()->route('admin.customer.index')->with([
103 103
             'alert' => [
104 104
                 'type' => 'alert-success',
105
-                'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.customer')]),
105
+                'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.customer') ]),
106 106
             ],
107 107
         ]);
108 108
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         return redirect()->route('admin.customer.index')->with([
121 121
             'alert' => [
122 122
                 'type' => 'alert-success',
123
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.customer')]),
123
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.customer') ]),
124 124
             ],
125 125
         ]);
126 126
     }
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function destroyMultiple(Request $request)
135 135
     {
136
-        Customer::destroy($request->input('checkbox', []));
136
+        Customer::destroy($request->input('checkbox', [ ]));
137 137
 
138 138
         return redirect()->route('admin.customer.index')->with([
139 139
             'alert' => [
140 140
                 'type' => 'alert-success',
141
-                'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.customer')]),
141
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.customer') ]),
142 142
             ],
143 143
         ]);
144 144
     }
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function destroyIdentitycardImage(Customer $customer)
153 153
     {
154
-        Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH . '/' . $customer->getRawOriginal('identitycard_image'));
154
+        Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH.'/'.$customer->getRawOriginal('identitycard_image'));
155 155
 
156
-        $customer->update(['identitycard_image' => null]);
156
+        $customer->update([ 'identitycard_image' => null ]);
157 157
 
158 158
         return redirect()->route('admin.customer.edit', $customer)->with([
159 159
             'alert' => [
160 160
                 'type' => 'alert-success',
161
-                'message' => trans('The :resource was deleted!', ['resource' => trans('This image')]),
161
+                'message' => trans('The :resource was deleted!', [ 'resource' => trans('This image') ]),
162 162
             ],
163 163
         ]);
164 164
     }
Please login to merge, or discard this patch.
database/factories/CustomerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             'whatsapp_phone' => $this->faker->numerify('081#########'),
40 40
             'account_number' => $this->faker->numerify('#########'),
41 41
             'identitycard_number' => $this->faker->numerify('################'),
42
-            'identitycard_image' => UploadedFile::fake()->image(Str::random() . '.jpg'),
42
+            'identitycard_image' => UploadedFile::fake()->image(Str::random().'.jpg'),
43 43
             'location_latitude' => $this->faker->latitude,
44 44
             'location_longitude' => $this->faker->longitude,
45 45
         ];
Please login to merge, or discard this patch.
app/Models/Concerns/Customer/Attribute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             return asset('img/stisla/avatar/avatar-1.png');
38 38
         }
39 39
 
40
-        return Storage::url(static::IDENTITYCARD_IMAGE_PATH . '/' . $value);
40
+        return Storage::url(static::IDENTITYCARD_IMAGE_PATH.'/'.$value);
41 41
     }
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
app/Models/Order.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $date ??= Carbon::today();
53 53
 
54
-        return $prefix . '-' . $date->format('Ymd') . '-' . Str::random(5);
54
+        return $prefix.'-'.$date->format('Ymd').'-'.Str::random(5);
55 55
     }
56 56
 
57 57
     /**
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public static function findOrCreateFromCode(?string $code, Customer $customer, callable $callable = null)
66 66
     {
67
-        return static::where('code', $code)->firstOr(function () use ($customer, $callable) {
67
+        return static::where('code', $code)->firstOr(function() use ($customer, $callable) {
68 68
             $order = new Order;
69 69
 
70 70
             $order->setCustomerRelationValue($customer)->save();
71 71
 
72
-            $orderStatus = new ModelOrderStatus(['status' => EnumOrderStatus::draft()]);
72
+            $orderStatus = new ModelOrderStatus([ 'status' => EnumOrderStatus::draft() ]);
73 73
 
74 74
             $order->statuses()->save(
75 75
                 $orderStatus->setIssuerableRelationValue($customer)
Please login to merge, or discard this patch.