Support the ongoing development of Laravel.io →
Input Forms Validation
Last updated 1 year ago.
0

It's hard to know what you're looking for exactly but the following code should make sure it's present and an array:

$rule = array(
    'item' => ['required', 'array'],
);
Last updated 1 year ago.
0

Excuse me, i want to set rule for array name of textbox.

// in view
echo Form::text('item[]');
echo Form::text('item[]');
echo Form::text('item[]');

//in controller
$rule=array(
   'item[]' => 'required'
);

but it don't work

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

yuomtheara yuomtheara Joined 12 Feb 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.