I have a controller that receives a call for post
, with some data in the request ( $request
). I need that controller to do a calculation and then redirect to another controller, sending the same data that he received in the body of the request. I have tried the following:
public function destino1(Request $request)
{
dump ("DESTINO 1: ", $request);
return redirect()->route('operatorDestino2')->with($request);
}
public function destino2(Request $request)
{
dd ("DESTINO 2: ", $request);
}
I've also tried the withInput()
method, instead of with()
.
However, this does not work. What I get is an exception of type MethodNotAllowedHttpException
, which gives me to understand that the redirect()
is not understood with the method post
, but redirects only by get
. That makes it impossible to pass the body of the petition.
Is there an alternative in Laravel to jump from one controller to another by passing the original $request
received by the first controller?