@@ -23,39 +23,39 @@ discard block |
||
| 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'); |
|
| 29 | + Route::prefix('/order')->name('order.')->group(function() { |
|
| 30 | + Route::post('/datatable', [ OrderController::class, 'datatable' ])->name('datatable'); |
|
| 31 | 31 | }); |
| 32 | 32 | |
| 33 | - Route::prefix('/user')->name('user.')->group(function () { |
|
| 34 | - Route::post('/datatable', [UserController::class, 'datatable'])->name('datatable'); |
|
| 33 | + Route::prefix('/user')->name('user.')->group(function() { |
|
| 34 | + Route::post('/datatable', [ UserController::class, 'datatable' ])->name('datatable'); |
|
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | - Route::prefix('/branch')->name('branch.')->group(function () { |
|
| 38 | - Route::post('/datatable', [BranchController::class, 'datatable'])->name('datatable'); |
|
| 37 | + Route::prefix('/branch')->name('branch.')->group(function() { |
|
| 38 | + Route::post('/datatable', [ BranchController::class, 'datatable' ])->name('datatable'); |
|
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - Route::prefix('/customer')->name('customer.')->group(function () { |
|
| 42 | - Route::post('/datatable', [CustomerController::class, 'datatable'])->name('datatable'); |
|
| 41 | + Route::prefix('/customer')->name('customer.')->group(function() { |
|
| 42 | + Route::post('/datatable', [ CustomerController::class, 'datatable' ])->name('datatable'); |
|
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - Route::prefix('/denomination')->name('denomination.')->group(function () { |
|
| 46 | - Route::post('/datatable', [DenominationController::class, 'datatable'])->name('datatable'); |
|
| 47 | - Route::delete('/multiple', [DenominationController::class, 'destroyMultiple'])->name('destroy-multiple'); |
|
| 48 | - Route::delete('/{denomination}/image', [DenominationController::class, 'destroyImage'])->name('destroy-image'); |
|
| 45 | + Route::prefix('/denomination')->name('denomination.')->group(function() { |
|
| 46 | + Route::post('/datatable', [ DenominationController::class, 'datatable' ])->name('datatable'); |
|
| 47 | + Route::delete('/multiple', [ DenominationController::class, 'destroyMultiple' ])->name('destroy-multiple'); |
|
| 48 | + Route::delete('/{denomination}/image', [ DenominationController::class, 'destroyImage' ])->name('destroy-image'); |
|
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - Route::prefix('/role')->name('role.')->middleware('role:admin')->group(function () { |
|
| 52 | - Route::post('/datatable', [RoleController::class, 'datatable'])->name('datatable'); |
|
| 53 | - Route::delete('/multiple', [RoleController::class, 'destroyMultiple'])->name('destroy-multiple'); |
|
| 51 | + Route::prefix('/role')->name('role.')->middleware('role:admin')->group(function() { |
|
| 52 | + Route::post('/datatable', [ RoleController::class, 'datatable' ])->name('datatable'); |
|
| 53 | + Route::delete('/multiple', [ RoleController::class, 'destroyMultiple' ])->name('destroy-multiple'); |
|
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | - Route::prefix('/configuration')->name('configuration.')->group(function () { |
|
| 57 | - Route::post('/datatable', [ConfigurationController::class, 'datatable'])->name('datatable'); |
|
| 58 | - Route::delete('/multiple', [ConfigurationController::class, 'destroyMultiple'])->middleware('role:admin')->name('destroy-multiple'); |
|
| 56 | + Route::prefix('/configuration')->name('configuration.')->group(function() { |
|
| 57 | + Route::post('/datatable', [ ConfigurationController::class, 'datatable' ])->name('datatable'); |
|
| 58 | + Route::delete('/multiple', [ ConfigurationController::class, 'destroyMultiple' ])->middleware('role:admin')->name('destroy-multiple'); |
|
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | 61 | Route::resource('/order', OrderController::class)->except('show'); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | Route::resource('/branch', BranchController::class)->except('show'); |
| 64 | 64 | Route::resource('/customer', CustomerController::class)->except('create', 'store', 'show'); |
| 65 | 65 | Route::resource('/denomination', DenominationController::class)->except('show'); |
| 66 | - Route::resource('/role', RoleController::class, ['middleware' => 'role:admin'])->except('show'); |
|
| 66 | + Route::resource('/role', RoleController::class, [ 'middleware' => 'role:admin' ])->except('show'); |
|
| 67 | 67 | Route::resource('/configuration', ConfigurationController::class)->except('show'); |
| 68 | 68 | }); |
| 69 | 69 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | return [ |
| 25 | 25 | 'name' => 'required|string|max:255', |
| 26 | 26 | 'value' => 'required|numeric|min:0', |
| 27 | - 'type' => 'required|enum:' . DenominationType::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 |
||
| 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; |
@@ -58,14 +58,14 @@ |
||
| 58 | 58 | $model = $this->route('denomination'); |
| 59 | 59 | |
| 60 | 60 | if ($model->getRawOriginal('image') && $this->hasFile($key)) { |
| 61 | - Storage::delete(Denomination::IMAGE_PATH . '/' . $model->getRawOriginal('image')); |
|
| 61 | + Storage::delete(Denomination::IMAGE_PATH.'/'.$model->getRawOriginal('image')); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $file = $this->file($key); |
| 65 | 65 | |
| 66 | 66 | $file->storeAs( |
| 67 | 67 | Denomination::IMAGE_PATH, |
| 68 | - $filename = ($this->input('value') . '.' . $file->getClientOriginalExtension()) |
|
| 68 | + $filename = ($this->input('value').'.'.$file->getClientOriginalExtension()) |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | return $filename; |
@@ -18,33 +18,3 @@ |
||
| 18 | 18 | public function toArray($request) |
| 19 | 19 | { |
| 20 | 20 | $typeBadge = sprintf(<<<'html' |
| 21 | - <span class="badge badge-%s"> |
|
| 22 | - <i class="fa fa-%s"></i> %s |
|
| 23 | - </span> |
|
| 24 | - html, |
|
| 25 | - $this->resource->type->isCoin() ? 'danger' : 'success', |
|
| 26 | - $this->resource->type->isCoin() ? 'coins' : 'money-bill', |
|
| 27 | - $this->resource->type->label |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - return [ |
|
| 31 | - 'checkbox' => view('components.datatables.checkbox', [ |
|
| 32 | - 'value' => $this->resource->getKey(), |
|
| 33 | - ])->render(), |
|
| 34 | - 'name' => $this->resource->name, |
|
| 35 | - 'value' => $this->resource->value, |
|
| 36 | - 'type' => $typeBadge, |
|
| 37 | - 'quantity_per_bundle' => $this->resource->quantity_per_bundle, |
|
| 38 | - 'action' => view('components.datatables.button-group', [ |
|
| 39 | - 'elements' => [ |
|
| 40 | - view('components.datatables.link-show', [ |
|
| 41 | - 'url' => route('admin.denomination.edit', $this->resource), |
|
| 42 | - ])->render(), |
|
| 43 | - view('components.datatables.link-destroy', [ |
|
| 44 | - 'url' => route('admin.denomination.destroy', $this->resource), |
|
| 45 | - ])->render(), |
|
| 46 | - ], |
|
| 47 | - ])->render(), |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 50 | -} |
|
@@ -18,33 +18,3 @@ |
||
| 18 | 18 | public function toArray($request) |
| 19 | 19 | { |
| 20 | 20 | $typeBadge = sprintf(<<<'html' |
| 21 | - <span class="badge badge-%s"> |
|
| 22 | - <i class="fa fa-%s"></i> %s |
|
| 23 | - </span> |
|
| 24 | - html, |
|
| 25 | - $this->resource->type->isCoin() ? 'danger' : 'success', |
|
| 26 | - $this->resource->type->isCoin() ? 'coins' : 'money-bill', |
|
| 27 | - $this->resource->type->label |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - return [ |
|
| 31 | - 'checkbox' => view('components.datatables.checkbox', [ |
|
| 32 | - 'value' => $this->resource->getKey(), |
|
| 33 | - ])->render(), |
|
| 34 | - 'name' => $this->resource->name, |
|
| 35 | - 'value' => $this->resource->value, |
|
| 36 | - 'type' => $typeBadge, |
|
| 37 | - 'quantity_per_bundle' => $this->resource->quantity_per_bundle, |
|
| 38 | - 'action' => view('components.datatables.button-group', [ |
|
| 39 | - 'elements' => [ |
|
| 40 | - view('components.datatables.link-show', [ |
|
| 41 | - 'url' => route('admin.denomination.edit', $this->resource), |
|
| 42 | - ])->render(), |
|
| 43 | - view('components.datatables.link-destroy', [ |
|
| 44 | - 'url' => route('admin.denomination.destroy', $this->resource), |
|
| 45 | - ])->render(), |
|
| 46 | - ], |
|
| 47 | - ])->render(), |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 50 | -} |
|
@@ -18,33 +18,3 @@ |
||
| 18 | 18 | public function toArray($request) |
| 19 | 19 | { |
| 20 | 20 | $typeBadge = sprintf(<<<'html' |
| 21 | - <span class="badge badge-%s"> |
|
| 22 | - <i class="fa fa-%s"></i> %s |
|
| 23 | - </span> |
|
| 24 | - html, |
|
| 25 | - $this->resource->type->isCoin() ? 'danger' : 'success', |
|
| 26 | - $this->resource->type->isCoin() ? 'coins' : 'money-bill', |
|
| 27 | - $this->resource->type->label |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - return [ |
|
| 31 | - 'checkbox' => view('components.datatables.checkbox', [ |
|
| 32 | - 'value' => $this->resource->getKey(), |
|
| 33 | - ])->render(), |
|
| 34 | - 'name' => $this->resource->name, |
|
| 35 | - 'value' => $this->resource->value, |
|
| 36 | - 'type' => $typeBadge, |
|
| 37 | - 'quantity_per_bundle' => $this->resource->quantity_per_bundle, |
|
| 38 | - 'action' => view('components.datatables.button-group', [ |
|
| 39 | - 'elements' => [ |
|
| 40 | - view('components.datatables.link-show', [ |
|
| 41 | - 'url' => route('admin.denomination.edit', $this->resource), |
|
| 42 | - ])->render(), |
|
| 43 | - view('components.datatables.link-destroy', [ |
|
| 44 | - 'url' => route('admin.denomination.destroy', $this->resource), |
|
| 45 | - ])->render(), |
|
| 46 | - ], |
|
| 47 | - ])->render(), |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 50 | -} |
|
@@ -18,33 +18,3 @@ |
||
| 18 | 18 | public function toArray($request) |
| 19 | 19 | { |
| 20 | 20 | $typeBadge = sprintf(<<<'html' |
| 21 | - <span class="badge badge-%s"> |
|
| 22 | - <i class="fa fa-%s"></i> %s |
|
| 23 | - </span> |
|
| 24 | - html, |
|
| 25 | - $this->resource->type->isCoin() ? 'danger' : 'success', |
|
| 26 | - $this->resource->type->isCoin() ? 'coins' : 'money-bill', |
|
| 27 | - $this->resource->type->label |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - return [ |
|
| 31 | - 'checkbox' => view('components.datatables.checkbox', [ |
|
| 32 | - 'value' => $this->resource->getKey(), |
|
| 33 | - ])->render(), |
|
| 34 | - 'name' => $this->resource->name, |
|
| 35 | - 'value' => $this->resource->value, |
|
| 36 | - 'type' => $typeBadge, |
|
| 37 | - 'quantity_per_bundle' => $this->resource->quantity_per_bundle, |
|
| 38 | - 'action' => view('components.datatables.button-group', [ |
|
| 39 | - 'elements' => [ |
|
| 40 | - view('components.datatables.link-show', [ |
|
| 41 | - 'url' => route('admin.denomination.edit', $this->resource), |
|
| 42 | - ])->render(), |
|
| 43 | - view('components.datatables.link-destroy', [ |
|
| 44 | - 'url' => route('admin.denomination.destroy', $this->resource), |
|
| 45 | - ])->render(), |
|
| 46 | - ], |
|
| 47 | - ])->render(), |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 50 | -} |
|
@@ -18,33 +18,3 @@ |
||
| 18 | 18 | public function toArray($request) |
| 19 | 19 | { |
| 20 | 20 | $typeBadge = sprintf(<<<'html' |
| 21 | - <span class="badge badge-%s"> |
|
| 22 | - <i class="fa fa-%s"></i> %s |
|
| 23 | - </span> |
|
| 24 | - html, |
|
| 25 | - $this->resource->type->isCoin() ? 'danger' : 'success', |
|
| 26 | - $this->resource->type->isCoin() ? 'coins' : 'money-bill', |
|
| 27 | - $this->resource->type->label |
|
| 28 | - ); |
|
| 29 | - |
|
| 30 | - return [ |
|
| 31 | - 'checkbox' => view('components.datatables.checkbox', [ |
|
| 32 | - 'value' => $this->resource->getKey(), |
|
| 33 | - ])->render(), |
|
| 34 | - 'name' => $this->resource->name, |
|
| 35 | - 'value' => $this->resource->value, |
|
| 36 | - 'type' => $typeBadge, |
|
| 37 | - 'quantity_per_bundle' => $this->resource->quantity_per_bundle, |
|
| 38 | - 'action' => view('components.datatables.button-group', [ |
|
| 39 | - 'elements' => [ |
|
| 40 | - view('components.datatables.link-show', [ |
|
| 41 | - 'url' => route('admin.denomination.edit', $this->resource), |
|
| 42 | - ])->render(), |
|
| 43 | - view('components.datatables.link-destroy', [ |
|
| 44 | - 'url' => route('admin.denomination.destroy', $this->resource), |
|
| 45 | - ])->render(), |
|
| 46 | - ], |
|
| 47 | - ])->render(), |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 50 | -} |
|
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function datatable() |
| 32 | 32 | { |
| 33 | 33 | return DataTables::eloquent(Denomination::query()) |
| 34 | - ->setTransformer(fn ($model) => DenominationResource::make($model)->resolve()) |
|
| 34 | + ->setTransformer(fn($model) => DenominationResource::make($model)->resolve()) |
|
| 35 | 35 | ->toJson(); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | return redirect()->route('admin.denomination.index')->with([ |
| 65 | 65 | 'alert' => [ |
| 66 | 66 | 'type' => 'alert-success', |
| 67 | - 'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.denomination')]), |
|
| 67 | + 'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.denomination') ]), |
|
| 68 | 68 | ], |
| 69 | 69 | ]); |
| 70 | 70 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | return redirect()->route('admin.denomination.index')->with([ |
| 101 | 101 | 'alert' => [ |
| 102 | 102 | 'type' => 'alert-success', |
| 103 | - 'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.denomination')]), |
|
| 103 | + 'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.denomination') ]), |
|
| 104 | 104 | ], |
| 105 | 105 | ]); |
| 106 | 106 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | return redirect()->route('admin.denomination.index')->with([ |
| 119 | 119 | 'alert' => [ |
| 120 | 120 | 'type' => 'alert-success', |
| 121 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.denomination')]), |
|
| 121 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.denomination') ]), |
|
| 122 | 122 | ], |
| 123 | 123 | ]); |
| 124 | 124 | } |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function destroyMultiple(Request $request) |
| 133 | 133 | { |
| 134 | - Denomination::destroy($request->input('checkbox', [])); |
|
| 134 | + Denomination::destroy($request->input('checkbox', [ ])); |
|
| 135 | 135 | |
| 136 | 136 | return redirect()->route('admin.denomination.index')->with([ |
| 137 | 137 | 'alert' => [ |
| 138 | 138 | 'type' => 'alert-success', |
| 139 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.denomination')]), |
|
| 139 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.denomination') ]), |
|
| 140 | 140 | ], |
| 141 | 141 | ]); |
| 142 | 142 | } |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function destroyImage(Denomination $denomination) |
| 151 | 151 | { |
| 152 | - Storage::delete(Denomination::IMAGE_PATH . '/' . $denomination->getRawOriginal('image')); |
|
| 152 | + Storage::delete(Denomination::IMAGE_PATH.'/'.$denomination->getRawOriginal('image')); |
|
| 153 | 153 | |
| 154 | - $denomination->update(['image' => null]); |
|
| 154 | + $denomination->update([ 'image' => null ]); |
|
| 155 | 155 | |
| 156 | 156 | return redirect()->route('admin.denomination.edit', $denomination)->with([ |
| 157 | 157 | 'alert' => [ |
| 158 | 158 | 'type' => 'alert-success', |
| 159 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('This image')]), |
|
| 159 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('This image') ]), |
|
| 160 | 160 | ], |
| 161 | 161 | ]); |
| 162 | 162 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 168 | 168 | */ |
| 169 | 169 | function format_rupiah(float $value, string $prefix = null): string |
| 170 | 170 | { |
| 171 | - return $prefix . number_format($value, 0, ',', '.'); |
|
| 171 | + return $prefix.number_format($value, 0, ',', '.'); |
|
| 172 | 172 | } |
| 173 | 173 | } |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected static function bootEvent() |
| 22 | 22 | { |
| 23 | - static::deleting(function (Denomination $model) { |
|
| 24 | - Storage::delete(Denomination::IMAGE_PATH . '/' . $model->getRawOriginal('image')); |
|
| 23 | + static::deleting(function(Denomination $model) { |
|
| 24 | + Storage::delete(Denomination::IMAGE_PATH.'/'.$model->getRawOriginal('image')); |
|
| 25 | 25 | }); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | return asset('img/dummy.png'); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - return Storage::url(static::IMAGE_PATH . '/' . $value); |
|
| 36 | + return Storage::url(static::IMAGE_PATH.'/'.$value); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | protected static function bootEvent() |
| 21 | 21 | { |
| 22 | - static::creating(function (Order $model) { |
|
| 22 | + static::creating(function(Order $model) { |
|
| 23 | 23 | $model->code = $model->generateCode(); |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | - static::deleting(function (Order $model) { |
|
| 26 | + static::deleting(function(Order $model) { |
|
| 27 | 27 | $model->items->delete(); |
| 28 | 28 | }); |
| 29 | 29 | } |