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