/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id, $noteId)
 {
     if ($this->projectService->checkProjectPermissions($id) == false) {
         return ['error' => 'Access forbidden'];
     }
     $result = $this->repository->with('project')->findWhere(['project_id' => $id, 'id' => $noteId]);
     if (isset($result['data']) && count($result['data']) == 1) {
         $result = ['data' => $result['data'][0]];
     }
     return $result;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     return $this->repository->with('project')->findWhere(['project_id' => $id]);
 }
 public function find($id)
 {
     return $this->repository->with(['owner', 'client'])->find($id);
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return $this->repository->with(['project'])->find($id);
 }