Пример #1
0
 /**
  * Update the specified OccupancyRoom in storage.
  * PUT/PATCH /occupancyRooms/{id}
  *
  * @param  int              $id
  * @param Request $request
  *
  * @return Response
  */
 public function update($id, Request $request)
 {
     $input = $request->all();
     /** @var OccupancyRoom $occupancyRoom */
     $occupancyRoom = $this->occupancyRoomRepository->apiFindOrFail($id);
     $result = $this->occupancyRoomRepository->updateRich($input, $id);
     $occupancyRoom = $occupancyRoom->fresh();
     return $this->sendResponse($occupancyRoom->toArray(), "OccupancyRoom updated successfully");
 }
Пример #2
0
 /**
  * Update the specified OccupancyRoom in storage.
  *
  * @param  int              $id
  * @param UpdateOccupancyRoomRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateOccupancyRoomRequest $request)
 {
     $occupancyRoom = $this->occupancyRoomRepository->find($id);
     if (empty($occupancyRoom)) {
         Flash::error('OccupancyRoom not found');
         return redirect(route('occupancyRooms.index'));
     }
     $this->occupancyRoomRepository->updateRich($request->all(), $id);
     Flash::success('OccupancyRoom updated successfully.');
     return redirect(route('occupancyRooms.index'));
 }