repository = $buyadds; parent::__construct(); } /** * Show buyadds's list. * * @param string $slug * * @return response */ protected function index() { $buyadds = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$buyadd::$buyadds.names')) ->view('$buyadd::public.buyadds.index') ->data(compact('$buyadds')) ->output(); } /** * Show buyadds's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $buyadds = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$buyadd::$buyadds.names')) ->view('$buyadd::public.buyadds.index') ->data(compact('$buyadds')) ->output(); } /** * Show buyadds. * * @param string $slug * * @return response */ protected function show($slug) { $buyadds = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$buyadds->name . trans('$buyadd::$buyadds.name')) ->view('$buyadd::public.buyadds.show') ->data(compact('$buyadds')) ->output(); } }