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