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