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