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