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