I'm trying to pass two parameters in the route, however, I get this error:
"Route pattern" / tab / {id} / client / {id} "can not reference variable name" id "more than once."
The route used:
Route::get('/visualizar/{ficha_id}/{cliente_id}', 'AnamneseController@visualizar')
->name('visualizar');
Button where the parameter is passed:
<a href="{{route('ficha.visualizar', ['ficha_id' => $f->id, 'cliente_id' => $cliente->id])}}">
Visualizar Ficha
</a>
Am I doing something wrong? What should I correct?
EDIT All application routes
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::group(['as' => 'cadastro.', 'prefix' => 'cadastro'], function () {
Route::get('/listar', 'CadastroController@index')->name('index');
Route::get('/adicionar', 'CadastroController@create')->name('adicionar');
Route::post('/salvar', 'CadastroController@store')->name('salvar');
Route::get('/{id}/visualizar', 'CadastroController@show')->name('visualizar');
Route::get('/{id}/editar', 'CadastroController@edit')->name('editar');
});
Route::group(['as' => 'ficha.', 'prefix' => 'ficha'], function () {
Route::get('/listar', 'AnamneseController@index')->name('index');
Route::get('/cliente/{id}/adicionar', 'AnamneseController@create')->name('adicionar');
Route::get('/{id}/cliente/{id}', 'AnamneseController@edit')->name('editar');
Route::post('/salvar', 'AnamneseController@store')->name('salvar');
Route::get('/visualizar/{ficha_id}/{cliente_id}', 'AnamneseController@visualizar')->name('visualizar');
});