diff --git a/requests.md b/requests.md index 2c0bcb36b9..c1902dd549 100644 --- a/requests.md +++ b/requests.md @@ -233,6 +233,12 @@ When given an array, the `has` method will determine if all of the specified val // } +The `whenHas` method will execute the given callback if a value is present on the request: + + $request->whenHas('name', function ($input) { + // + }); + The `hasAny` method returns `true` if any of the specified values are present: if ($request->hasAny(['name', 'email'])) { @@ -245,6 +251,12 @@ If you would like to determine if a value is present on the request and is not e // } +The `whenFilled` method will execute the given callback if a value is present on the request and is not empty: + + $request->whenFilled('name', function ($input) { + // + }); + To determine if a given key is absent from the request, you may use the `missing` method: if ($request->missing('name')) {