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