/** * @param DocumentRepository $repository */ public function getFind(DocumentRepository $repository) { $sectionId = $this->getRequiredParameter('section_id'); $keyword = $this->getParameter('q'); $excludeIds = (array) $this->getParameter('exclude', []); $documents = $repository->findByKeyword($sectionId, $keyword, $excludeIds); $this->setContent($documents); }
/** * @param DocumentRepository $repository * @param int $sectionId * @param int $documentId * * @return \Illuminate\Http\RedirectResponse */ public function postEdit(DocumentRepository $repository, $sectionId, $documentId) { $repository->validateOnUpdate($sectionId, $documentId, $this->request); $document = $repository->updateBySectionId($sectionId, $documentId, $this->request->all()); return $this->smartRedirect([$sectionId, $document->getId()])->with('success', trans($this->wrapNamespace('core.messages.document_updated'), ['title' => $document->getTitle()])); }