I got these routes:
Route::get('prefix/list/{page?}/{size?}', ['as' => 'prefix.list', 'uses' => 'MyController@getList']);
Route::post('prefix/list', ['as' => 'prefix.list', 'uses' => 'MyController@postList']);
When I call link_to_route()
like so:
{{ link_to_route('prefix.list', $page, ['page' => $page, 'size' => $size]) }}
It creates this link:
But when I remove the post route, it renders correctly this:
I don't want to change the name of the routes because my system depends on them being the same. How can I solve this?
You could try just changing the order of the routes in your routes file, so that the get one comes last and overrides the post for the purposes of link_to_route()
.