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