/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { $input = Request::all(); $validation = Course::validateUpdate($input, $id); if ($validation->fails()) { $message = $validation->messages()->first(); return Response()->json(ResponseManager::getError('', 10, $message)); } $course = Course::where('id', $id)->update($input); if ($course) { $message = 'Update Successfully.'; return Response()->json(ResponseManager::getResult($input, 10, $message)); } else { $message = 'Something went wrong. Please try again.'; return Response()->json(ResponseManager::getError('', 10, $message)); } }