Support the ongoing development of Laravel.io →
posted 10 years ago
Laravel.io
Last updated 2 years ago.
0

You should really consider naming the route. Laravel offers an option to avoid this happening by allowing you to set a constant name for your routes.

For example:


Route::get('/main.php?eid={id}', array(
     'as' => 'main.page',
     'uses' => 'PageController@someMethod'
));

Using this extra value with the key 'as', you can then direct users to the same route, regardless of the url from anywhere in your logic.

e.g.

public function someOtherMethod($id)
{
     return Redirect::to('main.page')->with('id', $id);
}

Let me know if this helps!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.