title: Laravel - Recreate custom request with validation on the fly
body: <p>I need to be able to recreate an <code>$request</code> variable, reach the validation of that request, and also beeing able to access route params (/foo/{user_id}) and query params (/foo?user_id), like this example.</p>
  
  <p>Note! This is an silly example, i know that this specific problem can be resolved in a much simpler way, but my current enviriment is too complexi to explain, also it would be unnecessary</p>
  
  <pre><code>
  class RandomController {
  
      // /foo/{field1}?field2
      public function create(CreateRequest $request) {
          if ($request-&gt;has('id') {
              $new_request = recreateRequest($request-&gt;only('field1', 'field2', 'field3')); // field3 is on the body
              return $this-&gt;update($new_request);
          }
      }
  
      public function update(UpdateRequest $request) {
          $request-&gt;field1; // /foo/{field1}
          $request-&gt;field2; // /foo?field2
          $request-&gt;field3; // {field3: }
      }
  
  }
  
  </code></pre>
  
  <p>Now I recreate the request passing it as an prop (CustomRequest::class) and using this following code, but it is unstable, sometimes it doesn't reach the request properties and I have to write <code>$request-&gt;request-&gt;field1</code> instead of <code>$request-&gt;field1</code></p>
  
  <pre><code>$created_request = new $new_request(
      $query ?: $old_request-&gt;query-&gt;all(),
      $request ?: $old_request-&gt;request-&gt;all(),
      $attributes ?: $old_request-&gt;attributes-&gt;all(),
      $cookies ?: $old_request-&gt;cookies-&gt;all(),
      $files ?: $old_request-&gt;files-&gt;all(),
      $server ?: $old_request-&gt;server-&gt;all()
  );
  </code></pre>