Sending data using redirect in Laravel

You can send data using redirects in Laravel by using below code

//Sending data
$data=['id'=>1,'name'=>'test'];
return Redirect::route('Controller.method')->with('data' => $data);
// retrieving data
Session::get('data');

Leave a Reply

Your email address will not be published. Required fields are marked *