title: Laravel API Request Validation
body: <p>Hello: I am writing an api with Laravel.</p>
  
  <p>When I try to use request validation in the controller, I get a 405 method not allowed. When I remove the request validation, everything runs smoothly.</p>
  
  <p>Here is my route:</p>
  
  <pre><code>Route::post('product/create', 'Api\v1\ProductController@create');
  </code></pre>
  
  <p>Here is my controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Api\v1;
  
  use App\Http\Requests\CreateProduct;
  use Illuminate\Http\Request;
  use App\Http\Controllers\Controller;
  use App\Handlers\Products;
  use Illuminate\Support\MessageBag;
  
  class ProductController extends Controller
  {
       /**
       * Create Product.
       */
      public function create(CreateProduct $request)
      {
         echo 'product created...';
      }
  }
  </code></pre>
  
  <p>Here is my request validator:</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Requests;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class CreateProduct 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 [
              'title' =&gt; 'required',
              'price' =&gt; 'required',
              'short_description' =&gt; 'required'
           ];
      }
  
       /**
       * Set custom validation messages.
       *
       * @return array
       */
      public function messages()
      {
          return [
              'title.required' =&gt; 'Please enter a title.',
              'price.required' =&gt; 'Please enter a price.',
              'short_description.required' =&gt; 'Please enter a short description.'
          ];
      }
  }
  </code></pre>
  
  <p>When I remove "CreateProduct $request" from the "create" method, everything works.</p>
  
  <p>How can I use Laravel's request validation for api calls?</p>