Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
timacdonald:missing
Jan 20, 2023
Merged

[9.x] Add "missing" validation rules#45717
taylorotwell merged 1 commit into
laravel:9.xfrom
timacdonald:missing

Conversation

@timacdonald

@timacdonald timacdonald commented Jan 19, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

@timacdonald

Copy link
Copy Markdown
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