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