repository = $store_locator; parent::__construct(); } /** * Show store_locator's list. * * @param string $slug * * @return response */ protected function index() { $store_locators = $this->repository->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('store_locator::public.store_locator.index', compact('store_locators'))->render(); } /** * Show store_locator. * * @param string $slug * * @return response */ protected function show($slug) { $store_locator = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('store_locator::public.store_locator.show', compact('store_locator'))->render(); } }