Skip to content

Commit 749f980

Browse files
Add array method in Request (#10452)
1 parent cdd572d commit 749f980

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎requests.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,15 @@ When dealing with HTML elements like checkboxes, your application may receive "t
394394
$archived = $request->boolean('archived');
395395
```
396396

397+
<a name="retrieving-array-input-values"></a>
398+
#### Retrieving Array Input Values
399+
400+
Input values containing arrays may be retrieved using the `array` method. This method will always cast the input value to an array. If the request does not contain an input value with the given name, an empty array will be returned:
401+
402+
```php
403+
$versions = $request->array('versions');
404+
```
405+
397406
<a name="retrieving-date-input-values"></a>
398407
#### Retrieving Date Input Values
399408

0 commit comments

Comments
 (0)