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