我似乎无法在控制器内为 PUT 操作分配功能。我尝试了一个 PUT 请求,/settings
但我得到了 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());
}
}