/** * Store a newly created resource in storage. * * @return Response */ public function store() { if (!is_bool($this->service->createService(Input::all()))) { return Redirect::back()->withInput()->withErrors($this->service->getMessage()); } return Redirect::route('service.index')->with('message', Helper::formatMessage("Service Added successfully!", 'success')); }
/** * Update the specified resource in storage. * * @param INT $id * @return Response */ public function update($id) { if (!is_bool($this->pet->updatePet(Input::all(), $id))) { return Redirect::back()->withInput()->withErrors($this->pet->getMessage()); } return Redirect::route('pet.index')->with('message', Helper::formatMessage("Record Updated successfully", 'success')); }
/** * Deleting Service * * @param int $id * @return Array */ public function removeService($id) { $response = array('valid' => 0, 'str' => 'Some error to delete'); $service = $this->getServiceById($id); $service->delete(); $response['valid'] = 1; $response['str'] = Helper::formatMessage("Service deleted successfully", 'success'); return $response; }
/** * Deleting pet * * @param int $id * @return Array */ public function removePet($id) { $response = array('valid' => 0, 'str' => 'Some error to delete'); $pet = $this->getPetById($id); $pet->delete(); $response['valid'] = 1; $response['str'] = Helper::formatMessage("Pet deleted successfully", 'success'); return $response; }