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