/** * Remove the specified Occupancy from storage. * * @param int $id * * @return Response */ public function destroy($id) { $occupancy = $this->occupancyRepository->find($id); if (empty($occupancy)) { Flash::error('Occupancy not found'); return redirect(route('occupancies.index')); } $this->occupancyRepository->delete($id); Flash::success('Occupancy deleted successfully.'); return redirect(route('occupancies.index')); }
/** * Remove the specified Occupancy from storage. * DELETE /occupancies/{id} * * @param int $id * * @return Response */ public function destroy($id) { $this->occupancyRepository->apiDeleteOrFail($id); return $this->sendResponse($id, "Occupancy deleted successfully"); }