Support the ongoing development of Laravel.io →
Forms Validation
Last updated 2 years ago.
0

please help me!

0

Hi,

You can make a foreach for validate your array.

For Laravel 5:

public function store(Request $request)
{
    foreach ($request->input('universities') as $university) {
        $v = \Validator::make(['university' => $university], ['university' => 'your validation rules comes here']);
        if ($v->fails()) {
            // handling validation fails
            } else {
                // ...
        }
    }
}
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kyllynk kyllynk Joined 4 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.