Testing with Laravel 5.1 I did not find any errors.
With the routes you indicate:
Route::patch('misvistas/docente/{id}', 'DocenteController@actualizarusuario');
Route::resource('misvistas/docente', 'DocenteController');
And a controller like the following:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class DocenteController extends Controller
{
public function index()
{
echo(get_class() . ' / index() <hr>');
}
public function actualizarusuario($id)
{
echo(get_class() . ' / actualizarusuario() -> ID: ' . $id . '<hr>');
}
public function show($id)
{
echo(get_class() . ' / show() -> ID: ' . $id . '<hr>');
}
} //class
If you make the GET request:
http://tuapp.com/misvistas/docente/1
You get:
App \ Http \ Controllers \ DocentController / show () - > ID: 1
If you make the PATCH request (and have previously disabled the CSRF protection *):
http://tuapp.com/misvistas/docente/1
You get:
App \ Http \ Controllers \ DocentController / updateuser () - > ID: 1
When listing routes using artisan:
php artisan route:list
appears among others the route you have defined:
PATCH | misvistas/docente/{id} |
| App\Http\Controllers\DocenteController@actualizarusuario
Check that you are using the correct verb in the request and your controller to see if you have any difference.
* Disable CSRF protection (only for local tests, re-activate later):
Go to the class "app / Http / Kernel.php" and comment the property line $middleware
:
\App\Http\Middleware\VerifyCsrfToken::class,