我正在编写几个API端点,我遇到了以下路径的问题。
路线:
Route::put('clients/{id}', 'ClientController@updateSettingsClient');
每当我运行请求时,它都会抛出This action is unauthorized.
错误。 ClientController
具有所需的功能。
每当我使用名称构建时,它都有效
Route::resource( 'clients', 'ClientController',['only' => ['index', 'store', 'show', 'update', 'destroy']] );
但我将拥有多个更新功能,因此我无法将它们命名为update
。
知道为什么会这样吗?