title: Laravel JS Validator library is not working if there multiple models
body: <p>In my laravel project, i have multiple tables which contains email id, (Example :Users table and agencies table) and am using JS validator for form validations. The problem is when i try to fill form of agencies,data's if i use a mail id which is not in agency table but already in users table it is triggering an error, <code>email is already taken</code>. But this email id is present only on users table and not in agency table.</p>
  
  <p>Following are my codes for validation and storing ()in Agency controller </p>
  
  <pre><code>protected $addValidationRules = [
                                          'name' =&gt; 'required|max:255',
                                          'username' =&gt;'required|max:255',
                                          'password' =&gt; 'required|min:6',
                                          'city' =&gt; 'required|max:255',
                                          'state' =&gt; 'required|max:255',
                                          'zip_code' =&gt; 'required|max:255',
                                          'email' =&gt; 'required|email|max:255|unique:users',
  
                                      ]; 
  </code></pre>
  
  <p>Following is my code for storing data in agency table</p>
  
  <pre><code>public function store(Request $request)
      {
          $postdata = $request-&gt;all();
          // echo "&lt;pre&gt;";print_r($postdata);exit;
  
  
          $validation = Validator::make($request-&gt;all(), $this-&gt;addValidationRules);
          if ($validation-&gt;fails()) {
  
              return redirect()-&gt;back()-&gt;withErrors($validation-&gt;errors())-&gt;withInput();
          }else{
  
              $name = isset($postdata['name']) ? $postdata['name'] : '';
              $username = isset($postdata['username']) ? $postdata['username'] : '';
              $password = isset($postdata['password']) ? $postdata['password'] : '';
              $city = isset($postdata['city']) ? $postdata['city'] : '';
              $state = isset($postdata['state']) ? $postdata['state'] : '';
              $zip = isset($postdata['zip_code']) ? $postdata['zip_code'] : '';
              $email = isset($postdata['email']) ? $postdata['email'] : '';
              $created_at = Carbon::now();
  
              try {
                  $agency = Agencie::create([
                      'agency_name' =&gt; $name,
                      'agency_user_name' =&gt; $username,
                      // 'payment_type' =&gt; $payment_type,
                      'password' =&gt; bcrypt($password),
                      'agency_city' =&gt; $city,
                      'agency_state' =&gt; $state,
                      'agency_zip' =&gt; $zip,
                      'email' =&gt; $email,
                      'agency_status' =&gt; 'ACTIVE',
                      'created_at' =&gt; $created_at
                  ]);
              // $agency-&gt;notify(new AgencyRegisteredNotification($agency));
              }catch (\Exception $e){
                  return $e-&gt;getMessage();
              }
  
              if($agency != ''){
                  Session::flash('message', 'Agency added Successfully');
                  Session::flash('msgclass', 'alert-success');
  
                  return Redirect::to('admin/agencies');
  
              }else{
                  Session::flash('message', 'Error while adding Agency');
                  Session::flash('msgclass', 'alert-danger');
                  return Redirect::to('admin/agencies');
              }
          }
      }
  </code></pre>
  
  <p>But please not that i want to take datas from user model also in this page so i used UserModel also , following is the code,</p>
  
  <pre><code>namespace App\Http\Controllers\Admin;
  
  use Illuminate\Http\Request;
  use App\Http\Controllers\Controller;
  
  use App\Agencie;
  use App\User;
  use DB;
  use JsValidator;
  use Validator;
  use Illuminate\Support\Str;
  use Session;
  use Redirect;
  use Carbon\Carbon;
  use App\Libraries\GlobalHelpers;
  use App\Libraries\ImageHelpers;
  use Auth;
  use Response;
  use App\Notifications\AgencyRegisteredNotification;
  </code></pre>
  
  <p>If that is the issue,how can i specifically validate this?</p>