title: try/catch PHP doesn't catch exceptions (laravel controller)
body: <p>I am working with Laravel and try to use try/catch as I would do for java. Unfortunately, it doesn't work as expected... The exception isn't catched, and instead of returning an error message, it makes a 422 exception.</p>
  
  <p>Here is my function:</p>
  
  <pre><code>public function changePassword(Request $request){
  
          try{
              if (!(Hash::check($request-&gt;get('currentpassword'), Auth::user()-&gt;password))) {
                  return "Your current password does not matches with the password you provided. Please try again.";
              }
  
              if(strcmp($request-&gt;get('currentpassword'), $request-&gt;get('new-password')) == 0){
                  return "New Password cannot be same as your current password. Please choose a different password.";
              }
  
              $validatedData = $request-&gt;validate([
                  'currentpassword' =&gt; 'required',
                  'newpassword' =&gt; 'required|string|min:6',
              ]);
  
              $user = Auth::user();
              $user-&gt;password = bcrypt($request-&gt;get('newpassword'));
              $user-&gt;save();
  
              return "Password changed successfully !";
          }
          catch(Exception $error){
              return $error-&gt;getMessage();
          }
     }
  </code></pre>
  
  <p>I call this method like this</p>
  
  <pre><code>Route::post('memberform/changePassword','MemberController@changePassword')-&gt;name('changePassword');
  </code></pre>
  
  <p>Here i would like to get my exception message, and display it. Instead, I get an error while using my request, and this exception isn't catched</p>
  
  <blockquote>
    <p>422 Unprocessable Entity
    {"message":"The given data was invalid.","errors":{"newpassword":["The newpassword must be at least 6 characters."]}}</p>
  </blockquote>
  
  <p>Thanks a lot</p>