/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { //$result = $this->repository->find($id)->delete(); $result = $this->repository->skipPresenter()->find($id)->delete(); if ($result) { return ['error' => 0]; } return ['error' => 1, 'msg' => 'Erro ao tentar deletar o Cliente']; }
public function destroy($id) { try { $this->repository->skipPresenter()->find($id)->delete(); return ['deleted' => 'true']; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'No data found for id:' . $id]; } catch (QueryException $e) { return ['error' => true, 'message' => 'You cannot delete this data, there is register related!']; } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { try { $this->repository->skipPresenter()->find($id)->delete(); return ['success' => true, 'message' => "Cliente deletado com sucesso!"]; } catch (QueryException $e) { return $this->erroMsgm('Cliente não pode ser apagado pois existe um ou mais projetos vinculados a ele.'); } catch (ModelNotFoundException $e) { return $this->erroMsgm('Cliente não encontrado.'); } catch (\Exception $e) { return $this->erroMsgm('Ocorreu um erro ao excluir o cliente.'); } }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { return $this->repository->skipPresenter()->find($id); }
public function createFile(array $data) { $project = $this->repository->skipPresenter()->find($data['project_id']); $projectFile = $project->files()->create($data); $this->storage->put($projectFile->id . '.' . $data['extension'], $this->filesystem->get($data['file'])); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->repository->skipPresenter()->find($id)->delete(); // $this->repository->delete($id); //return response("",404); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->repository->skipPresenter()->find($id)->delete(); }
public function getFilePath($id, $fileId) { $file = $this->repository->skipPresenter()->find($fileId); return $this->getBaseURL($file); }
public function all() { return $this->repository->skipPresenter()->all(); }