Skip to content

Commit 4f165ad

Browse files
committed
feat: merge uploaded files into validator attributes to enable file validation
1 parent 3e49d25 commit 4f165ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Http/Request/Request.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ public function jsonSerialize()
197197

198198
public function validate($rules, $messages = null, $attributeLabels = null)
199199
{
200+
if (!empty($this->files())) {
201+
$this->attributes = array_merge($this->attributes, $this->files());
202+
}
203+
200204
$validator = $this->make($this->attributes, $rules, $messages, $attributeLabels);
201205

202206
if ($validator->fails()) {

0 commit comments

Comments
 (0)