Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Add "missing" validation rules #45717

Merged
merged 1 commit into from
Jan 20, 2023
Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Jan 19, 2023

Missing is a strict version of the prohibits rule. Missing is implicit, so it runs even if the value is an empty string.

You can think of "missing" as running array_key_exists (but supporting dot notation).

Will follow up with documentation and skeleton PRs if we are happy with this one.

I have only added the permutations that I think have utility:

  • missing
  • missing_if:attribute,value
  • missing_unless:attribute,value
  • missing_with:attribute1,attribute2
  • missing_with_all:attribute1,attribute2

Skeleton: laravel/laravel#6078
Documentation: laravel/docs#8465

@timacdonald timacdonald changed the title [9.x] Add missing validation rules [9.x] Add "missing" validation rules Jan 19, 2023
@taylorotwell
Copy link
Member

Looks good, but needs corresponding method additions in ReplacesAttributes.php.

@timacdonald
Copy link
Member Author

Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants