modules = $this->modules(config('litecms.lead.modules'), 'lead', guard_url('lead')); $this->repository = $lead; } /** * Show lead'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(LeadPublicFilter::class) ->setPresenter(LeadListPresenter::class) ->select('leads.*') ->paginate($pageLimit) ->withQueryString() ->toArray(); extract($data); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('lead::lead.names')) ->view('lead::public.lead.index') ->data(compact('data', 'meta', 'categories', 'tags', 'recent')) ->output(); } /** * Show lead. * * @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('lead::lead.name')) ->view('lead::public.lead.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }