Update Request

public function update(UpdateAppointmentRequest $request)
{
    try {
        $data = array_filter($request->only(['user_id','status','note']));
        $appointment = $this->appointment->findOrFail($request->input('id'));
        $result = $appointment->update($data);
        return response()->json(['created' => $result]);
    } catch(PDOException $e) {
        return $this->internalIssues($e->getMessage());
    }
}
原文地址:https://www.cnblogs.com/fenle/p/6259069.html