【发布时间】:2018-02-18 19:22:34
【问题描述】:
当我尝试更新时出现错误 .... PUT http://127.0.0.1:8000/api/task 405(不允许的方法),有人可以帮忙吗?
public function update(Request $request, $id)
{
$currentUser = JWTAuth::parseToken()->authenticate();
$task = $currentUser->tasks()->find($id);
if(!$task)
throw new NotFoundHttpException;
$task->fill($request->all());
if($task->save())
return $this->response->noContent();
else
return $this->response->error('could_not_update_task', 500);
}
【问题讨论】: