Skip to content

Array validation issue #194

@nikunjtrapasiya

Description

@nikunjtrapasiya

I am trying to validate the array but it doesn't validate. Below is my code. can you please suggest me where i am making an error.

My form

 <div class="testi_row remove-input-wrapper">
                    {!!  Form::label('testi', 'Testimonial') !!} <span class="myWordCount"></span>
                    <textarea class="form-control testi char_count" name="testi[]" cols="50" rows="10">{{ $testiOld }}</textarea>
                    <a href="" class="remove-input"><i class="fa fa-minus-circle" aria-hidden="true"></i></a>
                </div>

rules

 public function rules()
    {
        $rules = [
            'abn'=>'required|abn',
            'org_name'=>'required',
            'contact_email'=>'email',
            'contact_phone' => 'required_without_all:contact_mobile|phone:AU,fixed_line',
            'contact_mobile' => 'required_without_all:contact_phone|phone:AU,mobile',
            'product_name' => 'required',
            'website' => 'regex:/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/',
            'user.*'=>'email',
            'logo.*'=>'image|max:1000',
            'screenshots.*'=>'max:1000|mimes:jpg,png,gif,jpeg',
            'testi.*'=>'max:500'
        ];


        return $rules;
    }

sameway the image logo and screenshots validation doesn't work with array field.

The server side validation works correctly.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions