public function show($id, $noteId) { try { $data = $this->repository->findWhere(['project_id' => $id, 'id' => $noteId]); $result['data'] = ''; if (isset($data['data'][0]) && count($data['data'][0])) { $result['data'] = $data['data'][0]; } return $result; } catch (\Exception $e) { return ['error' => true, 'message' => 'Registro não encontrado.']; } }
/** * Display a listing of the resource. * * @return Response */ public function index($id) { return $this->repository->findWhere(['project_id' => $id]); }