@@ -23,7 +23,7 @@ |
||
23 | 23 | public function rules() |
24 | 24 | { |
25 | 25 | return [ |
26 | - 'key' => ['required', 'string', 'max:255', Rule::unique(Configuration::class)->ignoreModel($this->route('configuration'))], |
|
26 | + 'key' => [ 'required', 'string', 'max:255', Rule::unique(Configuration::class)->ignoreModel($this->route('configuration')) ], |
|
27 | 27 | 'value' => 'required|string|max:255', |
28 | 28 | 'description' => 'sometimes|nullable|string', |
29 | 29 | ]; |
@@ -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 | -} |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function datatable() |
30 | 30 | { |
31 | 31 | return DataTables::eloquent(Role::query()) |
32 | - ->setTransformer(fn ($model) => RoleResource::make($model)->resolve()) |
|
32 | + ->setTransformer(fn($model) => RoleResource::make($model)->resolve()) |
|
33 | 33 | ->toJson(); |
34 | 34 | } |
35 | 35 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return redirect()->route('admin.role.index')->with([ |
57 | 57 | 'alert' => [ |
58 | 58 | 'type' => 'alert-success', |
59 | - 'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.role')]), |
|
59 | + 'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.role') ]), |
|
60 | 60 | ], |
61 | 61 | ]); |
62 | 62 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return redirect()->route('admin.role.index')->with([ |
87 | 87 | 'alert' => [ |
88 | 88 | 'type' => 'alert-success', |
89 | - 'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.role')]), |
|
89 | + 'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.role') ]), |
|
90 | 90 | ], |
91 | 91 | ]); |
92 | 92 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return redirect()->route('admin.role.index')->with([ |
105 | 105 | 'alert' => [ |
106 | 106 | 'type' => 'alert-success', |
107 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.role')]), |
|
107 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.role') ]), |
|
108 | 108 | ], |
109 | 109 | ]); |
110 | 110 | } |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function destroyMultiple(Request $request) |
119 | 119 | { |
120 | - Role::destroy($request->input('checkbox', [])); |
|
120 | + Role::destroy($request->input('checkbox', [ ])); |
|
121 | 121 | |
122 | 122 | return redirect()->route('admin.role.index')->with([ |
123 | 123 | 'alert' => [ |
124 | 124 | 'type' => 'alert-success', |
125 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.role')]), |
|
125 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.role') ]), |
|
126 | 126 | ], |
127 | 127 | ]); |
128 | 128 | } |
@@ -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 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function datatable() |
30 | 30 | { |
31 | 31 | return DataTables::eloquent(Configuration::query()) |
32 | - ->setTransformer(fn ($model) => ConfigurationResource::make($model)->resolve()) |
|
32 | + ->setTransformer(fn($model) => ConfigurationResource::make($model)->resolve()) |
|
33 | 33 | ->toJson(); |
34 | 34 | } |
35 | 35 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return redirect()->route('admin.configuration.index')->with([ |
57 | 57 | 'alert' => [ |
58 | 58 | 'type' => 'alert-success', |
59 | - 'message' => trans('The :resource was created!', ['resource' => trans('admin-lang.configuration')]), |
|
59 | + 'message' => trans('The :resource was created!', [ 'resource' => trans('admin-lang.configuration') ]), |
|
60 | 60 | ], |
61 | 61 | ]); |
62 | 62 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return redirect()->route('admin.configuration.index')->with([ |
87 | 87 | 'alert' => [ |
88 | 88 | 'type' => 'alert-success', |
89 | - 'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.configuration')]), |
|
89 | + 'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.configuration') ]), |
|
90 | 90 | ], |
91 | 91 | ]); |
92 | 92 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return redirect()->route('admin.configuration.index')->with([ |
105 | 105 | 'alert' => [ |
106 | 106 | 'type' => 'alert-success', |
107 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.configuration')]), |
|
107 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.configuration') ]), |
|
108 | 108 | ], |
109 | 109 | ]); |
110 | 110 | } |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function destroyMultiple(Request $request) |
119 | 119 | { |
120 | - Configuration::destroy($request->input('checkbox', [])); |
|
120 | + Configuration::destroy($request->input('checkbox', [ ])); |
|
121 | 121 | |
122 | 122 | return redirect()->route('admin.configuration.index')->with([ |
123 | 123 | 'alert' => [ |
124 | 124 | 'type' => 'alert-success', |
125 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('admin-lang.configuration')]), |
|
125 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('admin-lang.configuration') ]), |
|
126 | 126 | ], |
127 | 127 | ]); |
128 | 128 | } |
@@ -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 | /** |
@@ -26,17 +26,17 @@ |
||
26 | 26 | $isCoin = $this->faker->boolean; |
27 | 27 | |
28 | 28 | $denomination = $isCoin |
29 | - ? $this->faker->randomElement([100, 200, 500, 1000]) |
|
30 | - : $this->faker->randomElement([1000, 2000, 5000, 10000, 20000, 50000, 75000, 100000]); |
|
29 | + ? $this->faker->randomElement([ 100, 200, 500, 1000 ]) |
|
30 | + : $this->faker->randomElement([ 1000, 2000, 5000, 10000, 20000, 50000, 75000, 100000 ]); |
|
31 | 31 | |
32 | 32 | return [ |
33 | 33 | 'name' => terbilang($denomination), |
34 | 34 | 'value' => $denomination, |
35 | 35 | 'type' => $isCoin ? DenominationType::coin() : DenominationType::banknote(), |
36 | - 'quantity_per_bundle' => $this->faker->randomElement([50, 100, 200]), |
|
36 | + 'quantity_per_bundle' => $this->faker->randomElement([ 50, 100, 200 ]), |
|
37 | 37 | 'minimum_order_bundle' => $minimum = $this->faker->numberBetween(1, 10), |
38 | 38 | 'maximum_order_bundle' => $this->faker->numberBetween($minimum, 10), |
39 | - 'image' => UploadedFile::fake()->image($denomination . '.jpg'), |
|
39 | + 'image' => UploadedFile::fake()->image($denomination.'.jpg'), |
|
40 | 40 | ]; |
41 | 41 | } |
42 | 42 | } |
@@ -17,12 +17,12 @@ |
||
17 | 17 | */ |
18 | 18 | public function up() |
19 | 19 | { |
20 | - Schema::create('denominations', function (Blueprint $table) { |
|
20 | + Schema::create('denominations', function(Blueprint $table) { |
|
21 | 21 | $table->id(); |
22 | 22 | |
23 | 23 | $table->string('name'); |
24 | 24 | $table->unsignedDecimal('value')->unique(); |
25 | - $table->string('type')->comment('Enum of ' . DenominationType::class); |
|
25 | + $table->string('type')->comment('Enum of '.DenominationType::class); |
|
26 | 26 | $table->unsignedInteger('quantity_per_bundle'); |
27 | 27 | $table->unsignedInteger('minimum_order_bundle'); |
28 | 28 | $table->unsignedInteger('maximum_order_bundle'); |