Routing prefix with slug not change url

hi i am trying to rename the path from edit to edit but there is no way. I am using prefix routing.

The added path is this:

Router::prefix(‘admin’, function (RouteBuilder $routes){
$routes->connect(’/eventos/editar/:slug’, [‘controller’ => ‘Eventos’, ‘action’ => ‘editarPrivado’])
->setPatterns([‘slug’ =>’[0-9a-z-]+’])


I have added EventosController.php in Controller/Admin/Eventos with action editarPrivado($slug) and view editar_privado.ctp in Template/Admin/Eventos/editar_privado.ctp.

The url that returns me when I press the edit button in the index view and show the edit_private view is: localhost:8765/admin/eventos/editar-privado/Presentacion-temporada-19-20 and I want it to show how to editar and not editar-privado

Thank you

I’m no routing expert, but I suspect it’s not matching this route because of the “/admin” at the beginning.

Sorry, I have already corrected the issue, I had forgotten to copy the router :: prefix, but in the routes.php file I had it set