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