コード例 #1
0
 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]);
 }
コード例 #2
0
 /**
  * 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;
 }
コード例 #3
0
 /**
  * @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;
 }
コード例 #4
0
 /**
  * @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);
     */
 }
コード例 #5
0
 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]);
 }
コード例 #7
0
 public function getFilePath($projectId, $fileId)
 {
     $file = $this->repository->findWhere(['project_id' => $projectId, 'id' => $fileId])->first();
     return $this->getBaseUrl($file);
 }