title: Validator for current password, new password and confirm new password laravel
body: <p>Hi there I am having trouble on validation this is my controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\website\settings;
  
  use Illuminate\Http\Request;
  use App\Http\Controllers\Controller;
  use App\Http\Requests\PasswordAccountRequest;
  use Auth;
  use Hash; 
  use App\User;
  use Validator;
  
  class AccountSettingsController extends Controller
  {
      public function changepassword(){
  
          return view('website.settings.account.password');
      }
      public function newpassword(PasswordAccountRequest $request){
  
          $auth_user_password =  Auth::user()-&gt;password; 
          $new_password = bcrypt($request['new_password']);
  
  
          if (Hash::check($request-&gt;input('current_password'), $auth_user_password)) {
  
              $user_profile = User::where('id', Auth::user()-&gt;id)-&gt;update(['password' =&gt; $new_password]);  
  
  
                  }
  
                  return redirect()-&gt;back()-&gt;with(['status' =&gt; 'Password changed successfully.']);    
  
       }
  } 
  </code></pre>
  
  <p>Here I have my form on blade:</p>
  
  <pre><code>&lt;form role="form" class="form" action="{{ url('/settings/password-change') }}" method="post" enctype="multipart/form-data"&gt;
      {{ csrf_field() }}  
          &lt;div class="row"&gt;
          &lt;div class="col-md-12"&gt;
              &lt;label class="notifications-label"&gt; @lang('general.change_account_pass') &lt;/label&gt;&lt;br&gt;
              &lt;label class="will-recieve-notifications"&gt;@lang('general.requested_a_pass_change') &lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;br&gt; 
  
      &lt;div class="row padding-30 padding-top-bottomm-0"&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group floating-label {{ $errors-&gt;has('current_password') ? ' has-error' : '' }}"&gt;
                                      &lt;input class="form-control" name="current_password"  id="regular2" type="text" value="" &gt;
                                          &lt;label for="regular2"&gt;@lang('general.current_password')&lt;/label&gt;
                                          @if ($errors-&gt;has('current_password'))
                                          &lt;span class="help-block"&gt;
                                              &lt;strong&gt;{{ $errors-&gt;first('current_password') }}&lt;/strong&gt;
                                          &lt;/span&gt;
                                          @endif
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                          &lt;/div&gt;
                              &lt;div class="row padding-30 padding-top-bottomm-0"&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group floating-label {{ $errors-&gt;has('new_password') ? ' has-error' : '' }}"&gt;
                                      &lt;input class="form-control" name="new_password"  id="regular2" type="text" value="" &gt;
                                          &lt;label for="regular2"&gt;@lang('general.new_password')&lt;/label&gt;
                                          @if ($errors-&gt;has('new_password'))
                                          &lt;span class="help-block"&gt;
                                              &lt;strong&gt;{{ $errors-&gt;first('new_password') }}&lt;/strong&gt;
                                          &lt;/span&gt;
                                          @endif
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                          &lt;/div&gt; 
                              &lt;div class="row padding-30 padding-top-bottomm-0"&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;div class="form-group floating-label {{ $errors-&gt;has('new_password') ? ' has-error' : '' }}"&gt;
                                      &lt;input class="form-control" name="confirm_new_password"  id="regular2" type="text" value="" &gt;
                                          &lt;label for="regular2"&gt;@lang('general.confirm_new_password')&lt;/label&gt;
                                          @if ($errors-&gt;has('new_password'))
                                          &lt;span class="help-block"&gt;
                                              &lt;strong&gt;{{ $errors-&gt;first('new_password') }}&lt;/strong&gt;
                                          &lt;/span&gt;
                                          @endif
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                          &lt;/div&gt;
                               &lt;div class="row settings-footer"&gt;
          &lt;div class="col-md-12 padding-0"&gt;
              &lt;button type="submit" class="btn save-lang"&gt;@lang('buttons.save_changes')&lt;/button&gt;
          &lt;/div&gt;
       &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And this is my model where I put my validations:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class PasswordAccountRequest extends FormRequest
  {
      /**
       * Determine if the user is authorized to make this request.
       *
       * @return bool
       */
      public function authorize()
      {
          return true;
  
      } 
  
      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
          return [
                  'current_password'         =&gt; 'required',
                  'new_password'             =&gt; 'required ',
                  'confirm_password'         =&gt; 'required |same:new_password',
              ]; 
      }
  }
  </code></pre>
  
  <p>As you can see on controller I am using  tha Hash check to compare the password the users types on the form with the old password. How is it possible to make the validation if the old password is wrong to show the validation message like this :
  <a href="https://i.stack.imgur.com/571uG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/571uG.jpg" alt="enter image description here"></a></p>
  
  <p>And for the other two the new password with the confirm new password when its not the same to show the message like this:
  <a href="https://i.stack.imgur.com/XiNeo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XiNeo.jpg" alt="enter image description here"></a></p>
  
  <p>Can someone please help me?</p>