middleware('web'); $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout')); $this->repository = $manufacturer; parent::__construct(); } /** * Show manufacturer's list. * * @param string $slug * * @return response */ protected function index() { $manufacturers = $this->repository ->pushCriteria(new \Assetdocs\Manufacturer\Repositories\Criteria\ManufacturerPublicCriteria()) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('manufacturer::public.manufacturer.index', compact('manufacturers'))->render(); } /** * Show manufacturer. * * @param string $slug * * @return response */ protected function show($slug) { $manufacturer = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('manufacturer::public.manufacturer.show', compact('manufacturer'))->render(); } }