Support the ongoing development of Laravel.io →
Forms Validation
Last updated 7 months 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 7 years ago.
0

Sign in to participate in this thread!

Full Stack Europe

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.

© 2022 Laravel.io - All rights reserved.