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