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