Skip to content

Commit d5e3e43

Browse files
authored
Document merge (#7297)
* Document `merge()` function * Fix typo
1 parent 95a8575 commit d5e3e43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

validation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,10 @@ In addition, the `Illuminate\Support\ValidatedInput` instance may be iterated ov
624624

625625
$email = $validated['email'];
626626

627+
If you would like to add additional fields to the validated data, you may call the `merge` method:
628+
629+
$validated = $request->safe()->merge(['name' => 'Taylor Otwell']);
630+
627631
If you would like to retrieve the validated data as a [collection](/docs/{{version}}/collections) instance, you may call the `collect` method:
628632

629633
$collection = $request->safe()->collect();

0 commit comments

Comments
 (0)