/**
  * 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'));
 }
예제 #2
0
 /**
  *  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'));
 }
예제 #3
0
 /**
  * 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;
 }
예제 #4
0
 /**
  * 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;
 }