modules = $this->modules(config('beejees.candidate.modules'), 'candidate', guard_url('candidate')); $this->repository = $candidate; } /** * Show candidate's list. * * @return response */ protected function index(PublicRequest $request) { $search = $request->search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $data = $this->repository ->pushFilter(RequestFilter::class) ->pushFilter(CandidatePublicFilter::class) ->setPresenter(CandidateListPresenter::class) ->select('candidates.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('candidate::candidate.names')) ->view('candidate::public.candidate.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show candidate. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $data = $this->repository ->findBySlug($slug) ->toArray(); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('candidate::candidate.name')) ->view('candidate::public.candidate.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }