I have two routes which accept optional parameters:
Route::get('application/cedula/{cedula}/{view?}/{model?}', 'App\Http\Controllers\ApplicationController@getCedulaInformationFromPublicServices')->name('application.cedula');
Route::post('application/cedula/{cedula}/verification/{code?}', 'App\Http\Controllers\ApplicationController@verifyApplicationCode')->name('application.confirm');
public function verifyApplicationCode( Request $request, String $cedula, String $code = NULL ) {...}
public function getCedulaInformationFromPublicServices( String $cedula, String $view = NULL, String $model = NULL){...}
When I make a POST request to application/cedula/0001001010/verification, without the optional parameter "{code?}", it enters to the GET route.
I know that it's passing "verification" to the GET endpoint as the optional parameter {view?}, but shouldn't the resquest type be enough to discern between which one to follow despite the endpoint names being similar.