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