Skip to content

Commit 45d6ce9

Browse files
authored
feat: [12.x] Prohibited If Declined and Prohibited If Accepted validation rules (#10337)
1 parent 6fdbe31 commit 45d6ce9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

validation.md

+11
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,8 @@ Below is a list of all available validation rules and their function:
11171117
[Present With All](#rule-present-with-all)
11181118
[Prohibited](#rule-prohibited)
11191119
[Prohibited If](#rule-prohibited-if)
1120+
[Prohibited If Accepted](#rule-prohibited-if-accepted)
1121+
[Prohibited If Declined](#rule-prohibited-if-declined)
11201122
[Prohibited Unless](#rule-prohibited-unless)
11211123
[Prohibits](#rule-prohibits)
11221124
[Required](#rule-required)
@@ -1996,6 +1998,15 @@ Validator::make($request->all(), [
19961998
'role_id' => Rule::prohibitedIf(fn () => $request->user()->is_admin),
19971999
]);
19982000
```
2001+
<a name="rule-prohibited-if-accepted"></a>
2002+
#### prohibited_if_accepted:_anotherfield_,...
2003+
2004+
The field under validation must be missing or empty if the _anotherfield_ field is equal to `"yes"`, `"on"`, `1`, `"1"`, `true`, or `"true"`.
2005+
2006+
<a name="rule-prohibited-if-declined"></a>
2007+
#### prohibited_if_declined:_anotherfield_,...
2008+
2009+
The field under validation must be missing or empty if the _anotherfield_ field is equal to `"no"`, `"off"`, `0`, `"0"`, `false`, or `"false"`.
19992010

20002011
<a name="rule-prohibited-unless"></a>
20012012
#### prohibited_unless:_anotherfield_,_value_,...

0 commit comments

Comments
 (0)