File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -188,11 +188,14 @@ protected function failedAuthorization()
188
188
/**
189
189
* Get a validated input container for the validated input.
190
190
*
191
- * @return \Illuminate\Support\ValidatedInput
191
+ * @param array|null $keys
192
+ * @return \Illuminate\Support\ValidatedInput|array
192
193
*/
193
- public function safe ()
194
+ public function safe (array $ keys = null )
194
195
{
195
- return $ this ->validator ->safe ();
196
+ return is_array ($ keys )
197
+ ? $ this ->validator ->safe ()->only ($ keys )
198
+ : $ this ->validator ->safe ();
196
199
}
197
200
198
201
/**
Original file line number Diff line number Diff line change @@ -510,11 +510,14 @@ public function validateWithBag(string $errorBag)
510
510
/**
511
511
* Get a validated input container for the validated input.
512
512
*
513
- * @return \Illuminate\Support\ValidatedInput
513
+ * @param array|null $keys
514
+ * @return \Illuminate\Support\ValidatedInput|array
514
515
*/
515
- public function safe ()
516
+ public function safe (array $ keys = null )
516
517
{
517
- return new ValidatedInput ($ this ->validated ());
518
+ return is_array ($ keys )
519
+ ? (new ValidatedInput ($ this ->validated ()))->only ($ keys )
520
+ : new ValidatedInput ($ this ->validated ());
518
521
}
519
522
520
523
/**
You can’t perform that action at this time.
0 commit comments