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