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