title: Laravel redirect to controller action with Request object
body: <p>In a Laravel 5.6 app I have a controller managing a product tree. The getTree() method is building up the tree from the db, the updateTree() modifies it. Both methods are called via ajax accepting Request parameters:</p>
  
  <p>blade:</p>
  
  <pre><code>$.get("{{ URL::to('api/gettree') }}", {
    data: $("#data").val()
    }, function(response) { ... });
  
  $.post("{{ URL::to('api/updatetree') }}", {
    data: $("#data").val()
    }, function(response) { ... });
  </code></pre>
  
  <p>routes:</p>
  
  <pre><code>Route::get("/gettree", "TreeController@getTree");
  Route::post("/updatetree", "TreeController@updateTree");
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>class TreeController extends Controller
  {
    public function updateTree(Request $request)
    {
      ... process $request-&gt;input() ...
      return redirect()-&gt;action("TreeController@getTree");
    }
  
    public function getTree(Request $request)
    {
      ...
      return view("admin.partials.itemtree", compact("data"));
    }
  ...
  }
  </code></pre>
  
  <p>What I am trying to achieve is to fire the getTree() method via a redirect to controller action after updateTree() has run, however this way I am failing to pass the Request object expected by getTree(). How would you go about this? Thanks beforehand! </p>