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