public function all($project_id) { if (is_null(Project::find($project_id))) { return Errors::invalidId($project_id); } return $this->repository->findWhere(['project_id' => $project_id]); }
/** * Display a listing of the resource. * * @return Response */ public function index($id_project) { $rtrn = $this->repository->findWhere(['project_id' => $id_project]); #$rtrn = $this->repository->all(); #dd($rtrn); return $rtrn; }
/** * @param int $id * @return Response */ public function show($id, $idFile) { $result = $this->repository->findWhere(['project_id' => $id, 'id' => $idFile]); if (isset($result['data']) && count($result['data']) == 1) { $result = ['data' => $result['data'][0]]; } return $result; }
/** * @param int $id * @return Response */ public function show($id, $idFile) { $result = $this->repository->findWhere(['project_id' => $id, 'id' => $idFile]); if (isset($result['data']) && count($result['data']) == 1) { $result = ['data' => $result['data'][0]]; } return $result; /* if($this->service->checkProjectPermissions($id) == false){ return ['error' => 'Access Forbidden']; } return $this->repository->find($id); */ }
public function show($id, $fileId) { return $this->repository->findWhere(['project_id' => $id, 'id' => $fileId]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index($id) { return $this->repository->findWhere(['project_id' => $id]); }
public function getFilePath($projectId, $fileId) { $file = $this->repository->findWhere(['project_id' => $projectId, 'id' => $fileId])->first(); return $this->getBaseUrl($file); }