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