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