title: Laravel 5.5 validate with custom messages
body: <p>I'm working on a pw change form in my laravel app. I want to use the validator with custom error messages.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>  $rules = [
      'username' =&gt; 'required|max:255',
      'oldpassword' =&gt; 'required|max:255',
      'newpassword' =&gt; 'required|min:6|max:255|alpha_num',
      'newpasswordagain' =&gt; 'required|same:newpassword',
    ];
    $messages = [
       'username.required' =&gt; Lang::get('userpasschange.usernamerequired'),
       'username.max:255' =&gt; Lang::get('userpasschange.usernamemax255'),
       'oldpassword.required' =&gt; Lang::get('userpasschange.oldpasswordrequired'),
       'oldpassword.max:255' =&gt; Lang::get('userpasschange.oldpasswordmax255'),
       'newpassword.required' =&gt; Lang::get('userpasschange.newpasswordrequired'),
       'newpassword.min:6' =&gt; Lang::get('userpasschange.newpasswordmin6'),
       'newpassword.max:255' =&gt; Lang::get('userpasschange.newpasswordmax255'),
       'newpassword.alpha_num' =&gt; Lang::get('userpasschange.newpasswordalpha_num'),
       'newpasswordagain.required' =&gt; Lang::get('userpasschange.newpasswordagainrequired'),
       'newpasswordagain.same:newpassword' =&gt; Lang::get('userpasschange.newpasswordagainsamenewpassword'),
   ];
  
    $validator = Validator::make($request-&gt;all(), $rules, $messages);
    $validator-&gt;setCustomMessages($messages);
  
    Log::debug("custommessages: " . json_encode($messages));
    Log::debug("messages: " . json_encode($validator-&gt;messages()));
  </code></pre>
  
  <p>In the log <strong>custommessages</strong> is shows my custom msgs, but in the next line there is the original <strong>messages</strong>. </p>
  
  <p>I'm working from the <a href="https://laravel.com/docs/5.5/validation#working-with-error-messages" rel="noreferrer">official doc</a>.</p>
  
  <p>Have anybody meet this problem? </p>
  
  <p>Thx for the answers in advance!</p>