/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkProjectOwner($id) == false) { return ['error' => 'Acesso Negado']; } $this->repository->find($id)->delete(); }
public function createFile(array $data) { if ($projectid = $this->repository->find($data->project_id) == null) { return "projeto nao existe"; } else { $project = $this->repository->skipPresenter()->find($data['project_id']); $projectFile = $project->files()->create($data); return $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->find($id)->delete(); }