Passed
Push — develop ( 62f833...95decf )
by Septianata
11:22
created
database/factories/OrderStatusFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     {
25 25
         return [
26 26
             'status' => EnumOrderStatus::from($this->faker->randomElement(EnumOrderStatus::toValues())),
27
-            'note' => $this->faker->randomElement([null, $this->faker->text]),
27
+            'note' => $this->faker->randomElement([ null, $this->faker->text ]),
28 28
         ];
29 29
     }
30 30
 
Please login to merge, or discard this patch.
database/factories/ItemFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
         return [
28 28
             'denomination_id' => $denomination,
29
-            'bundle_quantity' => $denomination->range_order_bundle[array_rand($denomination->range_order_bundle)],
29
+            'bundle_quantity' => $denomination->range_order_bundle[ array_rand($denomination->range_order_bundle) ],
30 30
         ];
31 31
     }
32 32
 }
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -23,45 +23,45 @@  discard block
 block discarded – undo
23 23
 
24 24
 Route::view('/', 'welcome');
25 25
 
26
-Route::middleware('auth:web', 'verified', 'user_is_active')->name('admin.')->group(function () {
26
+Route::middleware('auth:web', 'verified', 'user_is_active')->name('admin.')->group(function() {
27 27
     Route::get('/dashboard', DashboardController::class)->name('dashboard');
28 28
 
29
-    Route::prefix('/order')->name('order.')->group(function () {
30
-        Route::post('/datatable', [OrderController::class, 'datatable'])->name('datatable');
31
-        Route::post('/{order}/datatable-row-child', [OrderController::class, 'datatableRowChild'])->name('datatable-row-child');
32
-        Route::delete('/multiple', [OrderController::class, 'destroyMultiple'])->name('destroy-multiple');
29
+    Route::prefix('/order')->name('order.')->group(function() {
30
+        Route::post('/datatable', [ OrderController::class, 'datatable' ])->name('datatable');
31
+        Route::post('/{order}/datatable-row-child', [ OrderController::class, 'datatableRowChild' ])->name('datatable-row-child');
32
+        Route::delete('/multiple', [ OrderController::class, 'destroyMultiple' ])->name('destroy-multiple');
33 33
     });
34 34
 
35
-    Route::prefix('/user')->name('user.')->group(function () {
36
-        Route::post('/datatable', [UserController::class, 'datatable'])->name('datatable');
37
-        Route::delete('/multiple', [UserController::class, 'destroyMultiple'])->name('destroy-multiple');
35
+    Route::prefix('/user')->name('user.')->group(function() {
36
+        Route::post('/datatable', [ UserController::class, 'datatable' ])->name('datatable');
37
+        Route::delete('/multiple', [ UserController::class, 'destroyMultiple' ])->name('destroy-multiple');
38 38
     });
39 39
 
40
-    Route::prefix('/branch')->name('branch.')->group(function () {
41
-        Route::post('/datatable', [BranchController::class, 'datatable'])->name('datatable');
42
-        Route::delete('/multiple', [BranchController::class, 'destroyMultiple'])->name('destroy-multiple');
40
+    Route::prefix('/branch')->name('branch.')->group(function() {
41
+        Route::post('/datatable', [ BranchController::class, 'datatable' ])->name('datatable');
42
+        Route::delete('/multiple', [ BranchController::class, 'destroyMultiple' ])->name('destroy-multiple');
43 43
     });
44 44
 
45
-    Route::prefix('/customer')->name('customer.')->group(function () {
46
-        Route::post('/datatable', [CustomerController::class, 'datatable'])->name('datatable');
47
-        Route::delete('/multiple', [CustomerController::class, 'destroyMultiple'])->name('destroy-multiple');
48
-        Route::delete('/{customer}/identitycard_image', [CustomerController::class, 'destroyIdentitycardImage'])->name('destroy-identitycard_image');
45
+    Route::prefix('/customer')->name('customer.')->group(function() {
46
+        Route::post('/datatable', [ CustomerController::class, 'datatable' ])->name('datatable');
47
+        Route::delete('/multiple', [ CustomerController::class, 'destroyMultiple' ])->name('destroy-multiple');
48
+        Route::delete('/{customer}/identitycard_image', [ CustomerController::class, 'destroyIdentitycardImage' ])->name('destroy-identitycard_image');
49 49
     });
50 50
 
51
-    Route::prefix('/denomination')->name('denomination.')->group(function () {
52
-        Route::post('/datatable', [DenominationController::class, 'datatable'])->name('datatable');
53
-        Route::delete('/multiple', [DenominationController::class, 'destroyMultiple'])->name('destroy-multiple');
54
-        Route::delete('/{denomination}/image', [DenominationController::class, 'destroyImage'])->name('destroy-image');
51
+    Route::prefix('/denomination')->name('denomination.')->group(function() {
52
+        Route::post('/datatable', [ DenominationController::class, 'datatable' ])->name('datatable');
53
+        Route::delete('/multiple', [ DenominationController::class, 'destroyMultiple' ])->name('destroy-multiple');
54
+        Route::delete('/{denomination}/image', [ DenominationController::class, 'destroyImage' ])->name('destroy-image');
55 55
     });
56 56
 
57
-    Route::prefix('/role')->name('role.')->middleware('role:admin')->group(function () {
58
-        Route::post('/datatable', [RoleController::class, 'datatable'])->name('datatable');
59
-        Route::delete('/multiple', [RoleController::class, 'destroyMultiple'])->name('destroy-multiple');
57
+    Route::prefix('/role')->name('role.')->middleware('role:admin')->group(function() {
58
+        Route::post('/datatable', [ RoleController::class, 'datatable' ])->name('datatable');
59
+        Route::delete('/multiple', [ RoleController::class, 'destroyMultiple' ])->name('destroy-multiple');
60 60
     });
61 61
 
62
-    Route::prefix('/configuration')->name('configuration.')->group(function () {
63
-        Route::post('/datatable', [ConfigurationController::class, 'datatable'])->name('datatable');
64
-        Route::delete('/multiple', [ConfigurationController::class, 'destroyMultiple'])->middleware('role:admin')->name('destroy-multiple');
62
+    Route::prefix('/configuration')->name('configuration.')->group(function() {
63
+        Route::post('/datatable', [ ConfigurationController::class, 'datatable' ])->name('datatable');
64
+        Route::delete('/multiple', [ ConfigurationController::class, 'destroyMultiple' ])->middleware('role:admin')->name('destroy-multiple');
65 65
     });
66 66
 
67 67
     Route::resource('/order', OrderController::class)->except('show');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     Route::resource('/branch', BranchController::class)->except('show');
70 70
     Route::resource('/customer', CustomerController::class)->except('show');
71 71
     Route::resource('/denomination', DenominationController::class)->except('show');
72
-    Route::resource('/role', RoleController::class, ['middleware' => 'role:admin'])->except('show');
72
+    Route::resource('/role', RoleController::class, [ 'middleware' => 'role:admin' ])->except('show');
73 73
     Route::resource('/configuration', ConfigurationController::class)->except('show');
74 74
 });
75 75
 
Please login to merge, or discard this patch.
app/Support/helpers.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Illuminate\Support\Facades\Storage;
7 7
 use Illuminate\Support\Str;
8 8
 
9
-if (! function_exists('terbilang')) {
9
+if (!function_exists('terbilang')) {
10 10
     /**
11 11
      * Return the given value into readable number.
12 12
      *
@@ -15,49 +15,49 @@  discard block
 block discarded – undo
15 15
      */
16 16
     function terbilang($value): string
17 17
     {
18
-        $result = value(function () use ($value) {
19
-            $angka = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan', 'sepuluh', 'sebelas'];
18
+        $result = value(function() use ($value) {
19
+            $angka = [ '', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan', 'sepuluh', 'sebelas' ];
20 20
 
21 21
             $number = abs($value);
22 22
 
23 23
             switch (true) {
24 24
                 case $number < 12:
25
-                    return ' ' . $angka[$number];
25
+                    return ' '.$angka[ $number ];
26 26
 
27 27
                 case $number < 20:
28
-                    return terbilang($number - 10) . ' belas';
28
+                    return terbilang($number - 10).' belas';
29 29
 
30 30
                 case $number < 100:
31
-                    return terbilang($number / 10) . ' puluh ' . terbilang($number % 10);
31
+                    return terbilang($number / 10).' puluh '.terbilang($number % 10);
32 32
 
33 33
                 case $number < 200:
34
-                    return 'seratus ' . terbilang($number - 100);
34
+                    return 'seratus '.terbilang($number - 100);
35 35
 
36 36
                 case $number < 1000:
37
-                    return terbilang($number / 100) . ' ratus ' . terbilang($number % 100);
37
+                    return terbilang($number / 100).' ratus '.terbilang($number % 100);
38 38
 
39 39
                 case $number < 2000:
40
-                    return 'seribu ' . terbilang($number - 1000);
40
+                    return 'seribu '.terbilang($number - 1000);
41 41
 
42 42
                 case $number < 1000000:
43
-                    return terbilang($number / 1000) . ' ribu ' . terbilang($number % 1000);
43
+                    return terbilang($number / 1000).' ribu '.terbilang($number % 1000);
44 44
 
45 45
                 case $number < 1000000000:
46
-                    return terbilang($number / 1000000) . ' juta ' . terbilang($number % 1000000);
46
+                    return terbilang($number / 1000000).' juta '.terbilang($number % 1000000);
47 47
 
48 48
                 case $number < 1000000000000:
49
-                    return terbilang($number / 1000000000) . ' milyar ' . terbilang($number % 1000000000);
49
+                    return terbilang($number / 1000000000).' milyar '.terbilang($number % 1000000000);
50 50
 
51 51
                 case $number < 1000000000000000:
52
-                    return terbilang($number / 1000000000000) . ' trilyun ' . terbilang($number % 1000000000000);
52
+                    return terbilang($number / 1000000000000).' trilyun '.terbilang($number % 1000000000000);
53 53
             }
54 54
         });
55 55
 
56
-        return trim(($value < 0 ? 'minus ' : '') . $result);
56
+        return trim(($value < 0 ? 'minus ' : '').$result);
57 57
     }
58 58
 }
59 59
 
60
-if (! function_exists('greeting')) {
60
+if (!function_exists('greeting')) {
61 61
     /**
62 62
      * Return specific greeting based on the current hour.
63 63
      *
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     }
85 85
 }
86 86
 
87
-if (! function_exists('telegram_url')) {
87
+if (!function_exists('telegram_url')) {
88 88
     /**
89 89
      * Return base telegram bot API url.
90 90
      *
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     }
98 98
 }
99 99
 
100
-if (! function_exists('download_telegram_photo')) {
100
+if (!function_exists('download_telegram_photo')) {
101 101
     /**
102 102
      * Download telegram photo based on the given photo list.
103 103
      *
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      */
111 111
     function download_telegram_photo(array $photos, string $path)
112 112
     {
113
-        $photos = Arr::sort($photos, fn ($photo) => $photo['file_size']);
113
+        $photos = Arr::sort($photos, fn($photo) => $photo[ 'file_size' ]);
114 114
 
115
-        $photoId = Arr::last($photos)['file_id'];
115
+        $photoId = Arr::last($photos)[ 'file_id' ];
116 116
 
117 117
         throw_unless($photoId, InvalidArgumentException::class, sprintf(
118 118
             'Telegram file_id is not found', $photoId
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
             env('TELEGRAM_TOKEN'), $photoFilePath
132 132
         ));
133 133
 
134
-        $filename = Str::random() . '.' . pathinfo($photoFilePath, PATHINFO_EXTENSION);
134
+        $filename = Str::random().'.'.pathinfo($photoFilePath, PATHINFO_EXTENSION);
135 135
 
136
-        Storage::put($path . '/' . $filename, $photo);
136
+        Storage::put($path.'/'.$filename, $photo);
137 137
 
138 138
         return $filename;
139 139
     }
140 140
 }
141 141
 
142
-if (! function_exists('google_map_url')) {
142
+if (!function_exists('google_map_url')) {
143 143
     /**
144 144
      * Return google map url based on the given latitude and longitude.
145 145
      *
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     }
159 159
 }
160 160
 
161
-if (! function_exists('format_rupiah')) {
161
+if (!function_exists('format_rupiah')) {
162 162
     /**
163 163
      * Return number in rupiah format.
164 164
      *
@@ -168,6 +168,6 @@  discard block
 block discarded – undo
168 168
      */
169 169
     function format_rupiah(float $value, string $prefix = 'Rp'): string
170 170
     {
171
-        return $prefix . number_format($value, 0, ',', '.');
171
+        return $prefix.number_format($value, 0, ',', '.');
172 172
     }
173 173
 }
Please login to merge, or discard this patch.
app/Http/Resources/DataTables/OrderResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
                 'name' => $this->resource->customer->fullname,
31 31
             ])->render(),
32 32
             'item_total' =>
33
-                $this->resource->item_total_bundle_quantity . ' ' . trans('bundle') .
34
-                '<br>' .
33
+                $this->resource->item_total_bundle_quantity.' '.trans('bundle').
34
+                '<br>'.
35 35
                 format_rupiah($this->resource->item_total),
36 36
             'schedule_date' => $this->resource->schedule_date ?? trans('Unscheduled'),
37 37
             'status' => $this->resource->status->label,
Please login to merge, or discard this patch.
app/Conversations/ExchangeConversation.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
                 Button::create(view('conversations.register-customer.reply-customer_data-no')->render())->value('no'),
83 83
             ]);
84 84
 
85
-        return $this->ask($question, next: function (Answer $answer) use ($customer) {
85
+        return $this->ask($question, next: function(Answer $answer) use ($customer) {
86 86
             if (!$answer->isInteractiveMessageReply()) {
87 87
                 return;
88 88
             }
89 89
 
90
-            if (!in_array($value = $answer->getValue(), ['yes', 'no'])) {
90
+            if (!in_array($value = $answer->getValue(), [ 'yes', 'no' ])) {
91 91
                 return $this->displayCustomerData($customer, $this->fallbackMessage($answer->getText()));
92 92
             }
93 93
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $additionalParameters = $keyboard->toArray()
131 131
         );
132 132
 
133
-        return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $customer, $denominations) {
133
+        return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $customer, $denominations) {
134 134
             if (!$answer->isInteractiveMessageReply()) {
135 135
                 return;
136 136
             }
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
             }
145 145
 
146 146
             /** @var \App\Models\Order $order */
147
-            $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function (Order $order) {
148
-                $this->setUserStorage(['order_code' => $order->code]);
147
+            $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function(Order $order) {
148
+                $this->setUserStorage([ 'order_code' => $order->code ]);
149 149
             });
150 150
 
151 151
             if ($order->item_total > Configuration::getMaximumTotalOrderValue()) {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
              * If there is an order's item that has same denomination with the selected one,
157 157
              * then it will be deleted first before customer continue to record item.
158 158
              */
159
-            if ($item = $order->items()->whereHas('denomination', function ($query) use ($denomination) {
159
+            if ($item = $order->items()->whereHas('denomination', function($query) use ($denomination) {
160 160
                 $query->whereKey($denomination->getKey());
161 161
             })->first('id')) {
162 162
                 $item->delete();
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
         $keyboard = Keyboard::create(Keyboard::TYPE_INLINE)->resizeKeyboard();
182 182
         $unit = Str::lower($denomination->type->label);
183 183
 
184
-        collect($denomination->range_order_bundle)->chunk(3)->map(function (Collection $quantities) use ($keyboard, $unit) {
185
-            $keyboard->addRow(...$quantities->map(fn ($quantity) => KeyboardButton::create(
184
+        collect($denomination->range_order_bundle)->chunk(3)->map(function(Collection $quantities) use ($keyboard, $unit) {
185
+            $keyboard->addRow(...$quantities->map(fn($quantity) => KeyboardButton::create(
186 186
                 view('conversations.exchange.reply-bundle_quantity-quantity', compact('quantity'))->render()
187 187
             )->callbackData($quantity))->toArray());
188 188
         });
189 189
 
190 190
         $keyboard->addRow(
191 191
             KeyboardButton::create(
192
-                view('components.conversations.back', ['text' => 'opsi pilih nominal uang'])->render()
192
+                view('components.conversations.back', [ 'text' => 'opsi pilih nominal uang' ])->render()
193 193
             )->callbackData('back_to_denomination_option')
194 194
         );
195 195
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             $additionalParameters = $keyboard->toArray()
199 199
         );
200 200
 
201
-        return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $order, $denomination) {
201
+        return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $order, $denomination) {
202 202
             $this->deleteTelegramMessageFromResponse($response);
203 203
 
204 204
             if ($answer->getValue() === 'back_to_denomination_option') {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             $additionalParameters = $keyboard->toArray()
256 256
         );
257 257
 
258
-        return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $responseConfirmOrder, $order) {
258
+        return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $responseConfirmOrder, $order) {
259 259
             $this->deleteTelegramMessageFromResponse($response);
260 260
 
261 261
             switch ($answer->getValue()) {
Please login to merge, or discard this patch.
app/Providers/GoogleDriveServiceProvider.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,23 +18,23 @@
 block discarded – undo
18 18
      */
19 19
     public function boot()
20 20
     {
21
-        Storage::extend('google', function ($app, $config) {
21
+        Storage::extend('google', function($app, $config) {
22 22
             $client = new Google_Client;
23 23
 
24
-            $client->setClientId($config['clientId']);
25
-            $client->setClientSecret($config['clientSecret']);
26
-            $client->refreshToken($config['refreshToken']);
24
+            $client->setClientId($config[ 'clientId' ]);
25
+            $client->setClientSecret($config[ 'clientSecret' ]);
26
+            $client->refreshToken($config[ 'refreshToken' ]);
27 27
 
28 28
             /** @var \Google\Service\Drive|\Google_Service_Drive $service */
29 29
             $service = new Drive($client);
30 30
 
31
-            $options = [];
31
+            $options = [ ];
32 32
 
33
-            if (isset($config['teamDriveId'])) {
34
-                $options['teamDriveId'] = $config['teamDriveId'];
33
+            if (isset($config[ 'teamDriveId' ])) {
34
+                $options[ 'teamDriveId' ] = $config[ 'teamDriveId' ];
35 35
             }
36 36
 
37
-            $adapter = new GoogleDriveAdapter($service, $config['folderId'], $options);
37
+            $adapter = new GoogleDriveAdapter($service, $config[ 'folderId' ], $options);
38 38
 
39 39
             return new Filesystem($adapter);
40 40
         });
Please login to merge, or discard this patch.
app/Support/Auth/MultipleIdentifier.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
             return 'email';
21 21
         }
22 22
 
23
-        if (!Validator::make(['phone' => $value], ['phone' => 'phone:ID'])->fails()) {
23
+        if (!Validator::make([ 'phone' => $value ], [ 'phone' => 'phone:ID' ])->fails()) {
24 24
             return 'phone';
25 25
         }
26 26
 
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $field = static::getIdentifierField($value);
39 39
 
40
-        $rules = ['required', 'string', 'exists:' . User::class . ',' . $field];
40
+        $rules = [ 'required', 'string', 'exists:'.User::class.','.$field ];
41 41
 
42 42
         switch ($field) {
43 43
             case 'email':
44
-                $rules[] = 'email';
44
+                $rules[ ] = 'email';
45 45
                 break;
46 46
 
47 47
             case 'phone':
48
-                $rules[] = 'phone:ID';
48
+                $rules[ ] = 'phone:ID';
49 49
                 break;
50 50
         }
51 51
 
Please login to merge, or discard this patch.
app/Http/Requests/Auth/LoginRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function attributes()
34 34
     {
35 35
         return [
36
-            'identifier' => trans('Email') . ' / ' .trans('Phone Number') . ' / Username',
36
+            'identifier' => trans('Email').' / '.trans('Phone Number').' / Username',
37 37
         ];
38 38
     }
39 39
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $this->ensureIsNotRateLimited();
61 61
 
62
-        if (! Auth::attempt(static::getCredentials($this), $this->boolean('remember'))) {
62
+        if (!Auth::attempt(static::getCredentials($this), $this->boolean('remember'))) {
63 63
             RateLimiter::hit($this->throttleKey());
64 64
 
65 65
             throw ValidationException::withMessages([
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function ensureIsNotRateLimited()
81 81
     {
82
-        if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
82
+        if (!RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
83 83
             return;
84 84
         }
85 85
 
@@ -102,6 +102,6 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function throttleKey()
104 104
     {
105
-        return Str::lower($this->input('email')) . '|'. $this->ip();
105
+        return Str::lower($this->input('email')).'|'.$this->ip();
106 106
     }
107 107
 }
Please login to merge, or discard this patch.