mirror of
https://github.com/10h30/Test-Laravel-Validation.git
synced 2026-06-05 15:07:56 +09:00
Task 2 - array validation
This commit is contained in:
@@ -33,3 +33,18 @@ Test method `test_simple_validation_rules()`.
|
||||
|
||||
---
|
||||
|
||||
## Task 2. Array Validation.
|
||||
|
||||
Imagine your form has fields as an array:
|
||||
|
||||
```
|
||||
<input name="profile[name]" ... />
|
||||
<input name="profile[email]" ... />
|
||||
```
|
||||
|
||||
In `app/Http/Controllers/ProfileController.php` file, the `update()` method need validation rules: profile[name] and profile[email] fields should be required.
|
||||
|
||||
Test method `test_array_validation()`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user