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