我似乎无法在控制器内为PUT操作分配一个函数。我在/settings
上尝试了PUT请求,但我得到了403 Forbidden。
我已在Route::controller('settings', 'SettingsController')
声明routes.php
:
<?php
class SettingsController extends BaseController {
public function getIndex() {
$setting = Auth::user()->setting;
return Response::json($setting);
}
public function putIndex() {
$setting = Auth::user()->setting;
$setting->update(Input::all());
}
}
答案 0 :(得分:0)
您的网络服务器可能阻止了PUT请求吗?
Why does my web server software disallow PUT and DELETE requests?
这意味着当您尝试执行PUT时,服务器将返回403。