public function deleteFile($id) { try { $projectFile = $this->projectFileRepository->skipPresenter()->find($id); if ($this->storage->exists($projectFile->getFileName())) { $this->storage->delete($projectFile->getFilename()); $this->projectFileRepository->delete($id); } return ["error" => false, "message" => "Arquivo deletado."]; } catch (ValidatorException $e) { return ["sucess" => false, "message" => $e->getMessageBag()]; } }
public function show($id, $fileId) { return $this->repository->findWhere(['project_id' => $id, 'id' => $fileId]); }