title: How can I solve "Type error: Argument 1 passed to App\Http\Controllers\Controller::validate() must be an instance of Illuminate\Http\Request,"?
body: <p>My code like this : </p>
  
  <pre><code>public function functionA(Request $request)
  {
      ...
      if($request-&gt;get('data')) {
          //echo '&lt;pre&gt;';print_r($request-&gt;get('data'));echo '&lt;/pre&gt;';die();
          $data = json_decode($request-&gt;get('data'), true);
          $data = collect($data['data']);
          $this-&gt;validate($data, [
              'id'=&gt;'required|numeric',
              'quantity'=&gt;'required|numeric',
          ]);
          $input = $data-&gt;only('id', 'quantity','request_date');
          ...
      }
  }
  </code></pre>
  
  <p>The result of <code>echo '&lt;pre&gt;';print_r($request-&gt;get('data'));echo '&lt;/pre&gt;';die();</code> like this : </p>
  
  <blockquote>
    <p>{"data":{"id":46,"quantity":1,"total":100000,"information":"chelsea","name":"Hazard","request_date":"14-08-2017
    16:26:00"},"expired":"2017-08-14T06:27:00.738Z"}</p>
  </blockquote>
  
  <p>If the code executed, there exist error like this : </p>
  
  <blockquote>
    <p>Type error: Argument 1 passed to
    App\Http\Controllers\Controller::validate() must be an instance of
    Illuminate\Http\Request,...</p>
  </blockquote>
  
  <p>How can I solve the error?</p>