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

Add docs for isNotFilled() method on Request docs #9884

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,18 @@ If you would like to determine if a value is present on the request and is not a
// ...
}

If you would like to determine if a value is missing from the request or is an empty string, you may use the `isNotFilled` method:

if ($request->isNotFilled('name')) {
// ...
}

When given an array, the `isNotFilled` method will determine if all of the specified values are missing or empty:

if ($request->isNotFilled(['name', 'email'])) {
// ...
}

The `anyFilled` method returns `true` if any of the specified values is not an empty string:

if ($request->anyFilled(['name', 'email'])) {
Expand Down