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