Skip to content

Commit

Permalink
update: rules
Browse files Browse the repository at this point in the history
  • Loading branch information
HDVinnie committed Apr 15, 2024
1 parent fa2a5a2 commit 5682bd0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions app/Http/Requests/Staff/StoreGroupRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,39 +113,39 @@ public function rules(Request $request): array
'boolean',
],
'min_uploaded' => [
Rule::when((bool) $request->integer('autogroup'), [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'prohibited'),
],
'min_ratio' => [
Rule::when((bool) $request->integer('autogroup'), [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'min:0',
'max:99.99',
]),
], 'prohibited'),
],
'min_age' => [
Rule::when((bool) $request->integer('autogroup'), [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'prohibited'),
],
'min_avg_seedtime' => [
Rule::when((bool) $request->integer('autogroup'), [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'prohibited'),
],
'min_seedsize' => [
Rule::when((bool) $request->integer('autogroup'), [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'prohibited'),
],
];
}
Expand Down
20 changes: 10 additions & 10 deletions app/Http/Requests/Staff/UpdateGroupRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,39 +119,39 @@ public function rules(Request $request): array
'boolean',
],
'min_uploaded' => [
Rule::when((bool) $group->autogroup, [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'nullable'),
],
'min_ratio' => [
Rule::when((bool) $group->autogroup, [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'min:0',
'max:99.99',
]),
], 'nullable'),
],
'min_age' => [
Rule::when((bool) $group->autogroup, [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'nullable'),
],
'min_avg_seedtime' => [
Rule::when((bool) $group->autogroup, [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'nullable'),
],
'min_seedsize' => [
Rule::when((bool) $group->autogroup, [
Rule::when($request->boolean('autogroup'), [
'sometimes',
'integer',
'min:0',
]),
], 'nullable'),
],
];
}
Expand Down

0 comments on commit 5682bd0

Please sign in to comment.