Reputation: 81
I need to use something like this one :
return redirect()->action([HomeController::class, 'index'])->with('data'=>$data);
but I don't know how ?
Upvotes: 1
Views: 99
Reputation: 7111
Action method accepts two parameters which are array both. Second array is associative array of key as parameter name and value of parameter value. In your case it would be
return redirect()->action( [HomeController::class, 'index'], ['data' => $data] );
Docs.