/**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/userImgs/{id}",
  *      summary="Remove the specified userImg from storage",
  *      tags={"userImg"},
  *      description="Delete userImg",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of userImg",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var userImg $userImg */
     $userImg = $this->userImgRepository->find($id);
     if (empty($userImg)) {
         return Response::json(ResponseUtil::makeError('userImg not found'), 404);
     }
     $userImg->delete();
     return $this->sendResponse($id, 'userImg deleted successfully');
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/ajudas/{id}",
  *      summary="Remove the specified Ajuda from storage",
  *      tags={"Ajuda"},
  *      description="Delete Ajuda",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of Ajuda",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var Ajuda $ajuda */
     $ajuda = $this->ajudaRepository->find($id);
     if (empty($ajuda)) {
         return Response::json(ResponseUtil::makeError('Ajuda not found'), 404);
     }
     $ajuda->delete();
     return $this->sendResponse($id, 'Ajuda deleted successfully');
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/sysAreaAtuacaoManuals/{id}",
  *      summary="Remove the specified sysAreaAtuacaoManual from storage",
  *      tags={"sysAreaAtuacaoManual"},
  *      description="Delete sysAreaAtuacaoManual",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of sysAreaAtuacaoManual",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var sysAreaAtuacaoManual $sysAreaAtuacaoManual */
     $sysAreaAtuacaoManual = $this->SysAreaAtuacaoManualRepository->find($id);
     if (empty($sysAreaAtuacaoManual)) {
         return Response::json(ResponseUtil::makeError('sysAreaAtuacaoManual not found'), 404);
     }
     $sysAreaAtuacaoManual->delete();
     return $this->sendResponse($id, 'sysAreaAtuacaoManual deleted successfully');
 }
Beispiel #4
0
 public function sendResponse($result, $message)
 {
     return Response::json(ResponseUtil::makeResponse($message, $result));
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/sysAreaAtuacaos/{id}",
  *      summary="Remove the specified SysAreaAtuacao from storage",
  *      tags={"SysAreaAtuacao"},
  *      description="Delete SysAreaAtuacao",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of SysAreaAtuacao",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var SysAreaAtuacao $sysAreaAtuacao */
     $sysAreaAtuacao = $this->sysAreaAtuacaoRepository->find($id);
     if (empty($sysAreaAtuacao)) {
         return Response::json(ResponseUtil::makeError('SysAreaAtuacao not found'), 404);
     }
     $sysAreaAtuacao->delete();
     return $this->sendResponse($id, 'SysAreaAtuacao deleted successfully');
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/enderecos/{id}",
  *      summary="Remove the specified Endereco from storage",
  *      tags={"Endereco"},
  *      description="Delete Endereco",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of Endereco",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var Endereco $endereco */
     $endereco = $this->enderecoRepository->find($id);
     if (empty($endereco)) {
         return Response::json(ResponseUtil::makeError('Endereco not found'), 404);
     }
     $endereco->delete();
     return $this->sendResponse($id, 'Endereco deleted successfully');
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/userOngs/{id}",
  *      summary="Remove the specified UserOng from storage",
  *      tags={"UserOng"},
  *      description="Delete UserOng",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of UserOng",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var UserOng $userOng */
     $userOng = $this->userOngRepository->findWithoutFail($id);
     if (empty($userOng)) {
         return Response::json(ResponseUtil::makeError('UserOng not found'), 404);
     }
     $userOng->delete();
     return $this->sendResponse($id, 'UserOng deleted successfully');
 }
 /**
  * Get the proper failed validation response for the request.
  *
  * @param array $errors
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function response(array $errors)
 {
     $messages = implode(' ', array_flatten($errors));
     return Response::json(ResponseUtil::makeError($messages), 400);
 }
 /**
  * @param int $id
  * @return Response
  *
  * @SWG\Delete(
  *      path="/telefones/{id}",
  *      summary="Remove the specified Telefone from storage",
  *      tags={"Telefone"},
  *      description="Delete Telefone",
  *      produces={"application/json"},
  *      @SWG\Parameter(
  *          name="id",
  *          description="id of Telefone",
  *          type="integer",
  *          required=true,
  *          in="path"
  *      ),
  *      @SWG\Response(
  *          response=200,
  *          description="successful operation",
  *          @SWG\Schema(
  *              type="object",
  *              @SWG\Property(
  *                  property="success",
  *                  type="boolean"
  *              ),
  *              @SWG\Property(
  *                  property="data",
  *                  type="string"
  *              ),
  *              @SWG\Property(
  *                  property="message",
  *                  type="string"
  *              )
  *          )
  *      )
  * )
  */
 public function destroy($id)
 {
     /** @var Telefone $telefone */
     $telefone = $this->telefoneRepository->find($id);
     if (empty($telefone)) {
         return Response::json(ResponseUtil::makeError('Telefone not found'), 404);
     }
     $telefone->delete();
     return $this->sendResponse($id, 'Telefone deleted successfully');
 }