add nested array validation to form requests
This commit is contained in:
@@ -24,6 +24,10 @@ class StoreRequest extends FormRequest
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'fields' => 'required|array',
|
||||
'fields.*.name' => 'required|string',
|
||||
'fields.*.unit' => 'string',
|
||||
'fields.*.type' => 'required|string',
|
||||
'fields.*.option' => 'string',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ class UpdateRequest extends FormRequest
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'fields' => 'required|array',
|
||||
'fields.*.name' => 'required|string',
|
||||
'fields.*.unit' => 'string',
|
||||
'fields.*.type' => 'required|string',
|
||||
'fields.*.option' => 'string',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user