Support the ongoing development of Laravel.io →
Configuration Architecture Installation
Last updated 2 years ago.
0

The helper function returns the URL that belongs to the route with that name. So you can pass the result of that function into the redirect function, which expects a URL.

return redirect(route('home'));

As second parameter of the route() function you can fill route parameters if needed.

0

The redirect() function actually don't return a RedirectResponse, it is returning a Illuminate\Routing\Redirector. This class do have the route() method.

0

ftiersch said:

The helper function returns the URL that belongs to the route with that name. So you can pass the result of that function into the redirect function, which expects a URL.

return redirect(route('home'));

As second parameter of the route() function you can fill route parameters if needed.

Thanks for your reply.

christoffertyrefors said:

The redirect() function actually don't return a RedirectResponse, it is returning a Illuminate\Routing\Redirector. This class do have the route() method.

Ok, I understand, thanks so much.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

buixuanhai buixuanhai Joined 20 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.