title: Form Request Validation not working. It just loads the home page in postman
body: <p>I am trying to validate input data with a custom form request.
  The form request name is UpdatePassword. And i try to run the code by injecting it in my updatePassword() function in my Api/AuthController. I and it just redirects back to home page</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests\Api;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class UpdatePassword extends FormRequest
  {
  
  
      public function authorize()
      {
          return true;
      }
      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
  
          return [
              'email' =&gt; 'required|string|email|max:255|exists:users,email',
              'old_password' =&gt; 'required|string',
              'password' =&gt; 'required|string|confirmed'
          ];
      }
  }
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\API;
  
  use App\Http\Requests\Api\UpdatePassword;
  use App\Http\Controllers\Controller;
  
  use Illuminate\Http\Request;
  
  
  class AuthController extends controller
  {
  
      public function updatePassword(UpdatePassword $request){
  
  
              dd($request-&gt;all());
      }
  }
  </code></pre>
  
  <p>My Exceptions/Handler.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Exceptions;
  
  use Exception;
  use Illuminate\Auth\AuthenticationException;
  use Illuminate\Database\QueryException;
  use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
  use Illuminate\Http\Response;
  use Illuminate\Validation\ValidationException;
  
  class Handler extends ExceptionHandler
  {
      /**
       * A list of the exception types that are not reported.
       *
       * @var array
       */
      protected $dontReport = [
          //
      ];
  
      /**
       * A list of the inputs that are never flashed for validation exceptions.
       *
       * @var array
       */
      protected $dontFlash = [
          'password',
          'password_confirmation',
      ];
  
      /**
       * Report or log an exception.
       *
       * @param  \Exception  $exception
       * @return void
       */
      public function report(Exception $exception)
      {
          parent::report($exception);
      }
  
      /**
       * Render an exception into an HTTP response.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Exception  $exception
       * @return \Illuminate\Http\Response
       */
      public function render($request, Exception $exception)
      {
          return parent::render($request, $exception);
      }
  
    }
  </code></pre>
  
  <p>Here is my route  </p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Http\Request;
  
  /*
  |--------------------------------------------------------------------------
  | API Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register API routes for your application. These
  | routes are loaded by the RouteServiceProvider within a group which
  | is assigned the "api" middleware group. Enjoy building your API!
  |
  */
  
  Route::middleware('auth:api')-&gt;get('/user', function (Request $request) {
      return $request-&gt;user();
  });
  
  Route::group(['namespace' =&gt; 'Api'], function (){
  
      Route::group(['prefix' =&gt; 'user'], function (){
  
          Route::post('changePassword', 'AuthController@updatePassword');
      });
  });
  
  Here is the postman request and response  
  
  [![Here is the postman request and response][1]][1]
  
  
  when I 
  </code></pre>
  
  <p>try to run the code in postman it as an ajax request it doesn't work. the validation doesn't work. it just renders the home page. localhost:8000</p>