/** * Submits the new source for processing * * @param NewSourceRequest $request * @param ProjectRepository $projectRepository * @throws Exception */ public function submitSource(NewSourceRequest $request, ProjectRepository $projectRepository) { try { $projectRepository->store($this->request->except(['email', 'receivers'])); } catch (Exception $e) { throw $e; } }
/** * Display a listing of the resource, matching the passed search parameters. * * @param $projectUuid * @return \Illuminate\Support\Facades\Response * @throws Exception */ public function search($projectUuid) { try { $project = $this->projectRepository->findByUuid($projectUuid, [], ['id']); if (is_null($project)) { return $this->errorNotFound(trans('exceptions.projectNotFound')); } $notes = $this->noteService->getByProjectAndSearch($project, $this->request->get('searchvalues'), ['replies']); return $this->respondWithCollection($notes, new NoteTransformer()); } catch (Exception $e) { throw $e; return $this->errorInternalError(trans('exceptions.errorWhileFetchinNotes')); } }
/** * Store the project to the database * * @return static * @throws Exception */ protected function storeProject() { return $this->projectRepository->store(['uuid' => (string) Uuid::generate(4), 'video_id' => $this->source()->getId($this->getParam('path')), 'source_id' => $this->getParam('source_id'), 'path' => $this->getParam('path'), 'status_id' => Status::CREATE]); }