Laravel: redirect from controller to named route with prams in URL

In Laravel 5, you can use the helper methods:

return redirect()->route('route.name', [$param]);

You can use Redirect::route() to redirect to a named route and pass an array of parameters as the second argument

 Redirect::route('route.name',array('param1' => $param1,'param2' => $param2))

Hope this helps.


You can try this :

return redirect()->route('profile', [$user]);

This can help also if you are trying to redirect user to a profile with the id.

Tags:

Php

Laravel