public function update(array $data, $project_id, $note_id) { try { $data['project_id'] = $project_id; $this->validator->with($data)->passesOrFail(); return $this->repository->update($data, $note_id); } catch (ValidatorException $e) { return ['error' => true, 'message' => $e->getMessageBag()]; } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'A nota que está tentando atualizar não existe']; } }