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()); } }