When you use
Route::resource('misvistas/docente', 'DocenteController');
It generates the following 7 routes by default:
+-----------+----------------------------------+------------------+------------------------------------------------------------------------+--------------+
| Method | URI | Name | Action | Middleware |
+-----------+----------------------------------+------------------+------------------------------------------------------------------------+--------------+
| POST | misvistas/docente | docente.store | App\Http\Controllers\DocenteController@store | web |
| GET|HEAD | misvistas/docente | docente.index | App\Http\Controllers\DocenteController@index | web |
| GET|HEAD | misvistas/docente/create | docente.create | App\Http\Controllers\DocenteController@create | web |
| PUT|PATCH | misvistas/docente/{docente} | docente.update | App\Http\Controllers\DocenteController@update | web |
| GET|HEAD | misvistas/docente/{docente} | docente.show | App\Http\Controllers\DocenteController@show | web |
| DELETE | misvistas/docente/{docente} | docente.destroy | App\Http\Controllers\DocenteController@destroy | web |
| GET|HEAD | misvistas/docente/{docente}/edit | docente.edit | App\Http\Controllers\DocenteController@edit | web |
You can check the available routes with the php artisan route:list
command.
So DocenteController@editarUsuario
is not a defined path validity, to be able to use it before you must create it, so that it points to the indicated method:
Route::get('misvistas/mi_ruta/{id}', 'DocenteController@editarUsuario');
or you can overwrite the existing route created with resource
by matching the route ( misvistas/docente/{docente}/edit
in this case) so that it points to the method and controller that we want.
Route::get('misvistas/docente/{docente}/edit', 'DocenteController@editarUsuario')->name('docente.edit');