title: laravel how to validate as equal to a variable
body: <p>in laravel validation (registering) i want to compare one of the fields with a php variable (it should be equal with that)</p>
  
  <p>how can i do this?</p>
  
  <pre><code>protected function validator(array $data)
  {
  
      return Validator::make($data, [
          'name' =&gt; 'required|max:255',
          'phone' =&gt; 'required|min:10|max:11|unique:users',
          'email' =&gt; 'required|email|max:255',
          'password' =&gt; 'required',
          'password_confirmation' =&gt; 'required',
          'user_captcha' =&gt; 'required'
      ]);
  }
  </code></pre>