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