Support the ongoing development of Laravel.io →
Requests Input Views
Last updated 2 years ago.
0

I'm really not sure if I understood your question correctly but here's a try.

Consider this route:

Route::get('/test/:id/:category', ['as' => 'testroute', 'uses' => 'TestController@test']);

You can use the route() helper function to create a URL from a route name (in this case the routename is testroute). So in a controller you could do this:

return redirect(route('testroute', ['id' => 5, 'category' => 'testcategory']));

and the route() function would give you the URL /test/5/testcategory

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jonitopsg jonitopsg Joined 18 Jun 2014

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.