Support the ongoing development of Laravel.io →
Authentication Eloquent Validation

Hey all,

I have a form being validated that works fine when i'm using $results = $query->get(); but is ignored when I use $results = $query->Paginate(5); My validation is below. Any ideas on how I can make it work?

Thanks in advance:

$rules = array(
          'field_name' => 'required_without_all:field_Name,field_name',
          'field_name' => 'required_without_all:field_Name,field_name',
          'field_name' => 'required_without_all:field_Name,field_name'
            );

             // check if the validator failed
            $validator = Validator::make(Input::all(), $rules);

            // check if the validator failed
            if ($validator->fails()) {

            // get the error messages from the validator
            $messages = $validator->messages();

// redirect our user back to the form with the errors from the validator
            return Redirect::to('index')
            ->withErrors($validator);
Last updated 3 years ago.
0

The answer to this issue is, you must add your validation logic before the input() information. Cheers hope this helps someone.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.