當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Role::lists方法代碼示例

本文整理匯總了PHP中app\Role::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Role::lists方法的具體用法?PHP Role::lists怎麽用?PHP Role::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Role的用法示例。


在下文中一共展示了Role::lists方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: edit

 public function edit($id)
 {
     $info = User::findOrFail($id);
     $userLists = User::lists('name', 'id');
     $userRoles = Role::lists('label', 'id');
     return view('user_role.edit', compact('info', 'userLists', 'userRoles'));
 }
開發者ID:shams1978,項目名稱:sadik_project,代碼行數:7,代碼來源:UserRoleController.php

示例2: edit

 /**
  * Show a user edit page
  *
  * @param $id
  *
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $roles = Role::lists('title', 'id');
     $sites = Sites::site_access()->lists('title', 'id');
     return view('admin.users.edit', compact('user', 'roles', 'sites'));
 }
開發者ID:AmirHome,項目名稱:CMS_20160115,代碼行數:14,代碼來源:UsersController.php

示例3: edit

 /**
  * Form for editing an existing permission with the given id is shown with this method.
  *
  * @param $id
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $permission = Permission::find($id);
     $roles = Role::lists('name', 'id');
     $routes = array_unique($this->getAuthorizedRoutes());
     return view('rbac-gui.permissions.edit', compact('permission', 'roles', 'routes'));
 }
開發者ID:JimiOhrid,項目名稱:shopStore,代碼行數:13,代碼來源:PermissionsController.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit(Employee $employee)
 {
     $title = "Edit: " . $employee->last_name . ', ' . $employee->first_name;
     $roles = \App\Role::lists('role', 'id');
     $projects = \App\Project::lists('name', 'id');
     return view('employees.edit', compact('employee', 'title', 'roles', 'projects'));
 }
開發者ID:gabrico92,項目名稱:adc-app,代碼行數:13,代碼來源:EmployeesController.php

示例5: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $roles = Role::lists('display_name', 'id');
     $columnSizes = ['sm' => [4, 8], 'lg' => [2, 10]];
     $tab = 'users';
     return view('admin.users.edit', compact('user', 'roles', 'tab', 'columnSizes'));
 }
開發者ID:Shoodey,項目名稱:Events,代碼行數:14,代碼來源:UsersController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $user = Auth::user();
     $user->load('roles.permissions')->get();
     $roles = Role::lists('name', 'id');
     //        dd($roles);
     return view('pages.dashboard', compact('user', 'roles'));
 }
開發者ID:sezertunca,項目名稱:laravel-simple-user-management-system,代碼行數:13,代碼來源:UMSController.php

示例7: run

 public function run()
 {
     $faker = Faker::create();
     DB::table('role_user')->insert(['role_id' => 1, 'user_id' => 1]);
     $usersIds = User::lists('id')->all();
     $rolesIds = Role::lists('id')->all();
     foreach (range(2, 6) as $index) {
         DB::table('role_user')->insert(['role_id' => $faker->randomElement($rolesIds), 'user_id' => $index]);
     }
 }
開發者ID:alons182,項目名稱:guanacastevende,代碼行數:10,代碼來源:UsersRolesTableSeeder.php

示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(User $user)
 {
     if ($user->cannot('edit', $user)) {
         return redirect('users');
     }
     //if(Gate::denies('edit', $user)) return redirect('users');//??
     $roles = \App\Role::lists('role', 'id');
     $countries = \App\Country::lists('name', 'id');
     return view('users.edit', compact('user', 'roles', 'countries'));
 }
開發者ID:TraianAlex,項目名稱:laravel4,代碼行數:16,代碼來源:UserController.php

示例9: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     if (\Auth::user()->roles[0]->can('menu-update')) {
         $menu = $this->menus->findOrFail($id);
         $items = $this->menus->lists('name', 'id')->toarray();
         $roles = Role::lists('name', 'id')->toarray();
         $selected = $menu->roles->lists('id')->toarray();
         return view('admin.menus.edit', compact('menu', 'selected', 'roles', 'items'));
     }
     return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
 }
開發者ID:meccado,項目名稱:acl-admin-control-panel,代碼行數:17,代碼來源:MenuController.php

示例10: getRegister

 /**
  * Show the application registration form.
  *
  * @return Response
  */
 public function getRegister()
 {
     // if ($this->agent->roles() == "Administrator")
     // {
     $roles = Role::lists('name', 'id');
     $programs = Program::lists('name', 'id');
     return view('auth.register', compact('roles', 'programs'));
     // }
     // else{
     //    return view('errors.unauth');
     // }
 }
開發者ID:ecortez3,項目名稱:CCO,代碼行數:17,代碼來源:AuthController.php

示例11: edit

 public function edit(Annoucement $annoucement)
 {
     if (!Entrust::can('edit_annoucement')) {
         return redirect('/dashboard')->withErrors(config('constants.NA'));
     }
     $selected_roles = array();
     foreach ($annoucement->Role as $role) {
         $selected_roles[] = $role->id;
     }
     $roles = Role::lists('display_name', 'id')->all();
     $custom_field_values = Helper::getCustomFieldValues($this->form, $annoucement->id);
     return view('annoucement.edit', compact('roles', 'annoucement', 'selected_roles', 'custom_field_values'));
 }
開發者ID:EneaWeb,項目名稱:aliangel,代碼行數:13,代碼來源:AnnoucementController.php

示例12: getRegister

 public function getRegister()
 {
     if (!Entrust::can('create_user')) {
         return redirect('/dashboard')->withErrors(config('constants.NA'));
     }
     $departments = Department::lists('department_name', 'id')->all();
     if (Entrust::hasRole('admin')) {
         $roles = Role::lists('name', 'id')->all();
     } else {
         $roles = Role::where('name', '!=', 'admin')->lists('name', 'id')->all();
     }
     return view('user.create', compact('departments', 'roles'));
 }
開發者ID:EneaWeb,項目名稱:aliangel,代碼行數:13,代碼來源:AuthController.php

示例13: ComposeWebPanelForms

 public function ComposeWebPanelForms()
 {
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.store.items._form', function ($view) {
         $view->with('categories', StoreCategory::lists('display_name', 'id'));
         $view->with('servers', StoreServer::lists('display_name', 'id'));
     });
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.store.categories._form', function ($view) {
         $view->with('servers', StoreServer::lists('display_name', 'id'));
     });
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.users._form', function ($view) {
         $view->with('roles', Role::lists('display_name', 'id'));
     });
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.roles._form', function ($view) {
         $view->with('permissions', Permission::lists('display_name', 'id'));
     });
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.panel.permissions._form', function ($view) {
         $view->with('roles', Role::lists('display_name', 'id'));
     });
 }
開發者ID:brucewu16899,項目名稱:WebPanel-Core,代碼行數:19,代碼來源:ViewComposerServiceProvider.php

示例14: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (Auth::user()->identifier == 3) {
         $title = 'dataUpdate';
         $roles = Role::lists('name', 'id');
         $rolesShow = Role::all();
         $functionalAreas = FunctionalAreas::lists('name', 'id');
         $faShow = FunctionalAreas::all();
         $industry = Industry::lists('name', 'id');
         $industryShow = Industry::all();
         $skills = Skills::lists('name', 'id');
         $indfunctionalMapping = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')->get([DB::raw('concat(industries.name, " - ", functional_areas.name) as name'), 'industry_functional_area_mappings.id as id'])->lists('name', 'id');
         $industryfareaShow = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')->get(['industries.name as name', 'functional_areas.name as fareaname', 'industry_functional_area_mappings.id']);
         // $indfunctional = Industry_functional_area_mappings::leftJoin('industries', 'industry_functional_area_mappings.industry', '=', 'industries.id')
         // 														 ->leftJoin('functional_areas', 'industry_functional_area_mappings.functional_area', '=', 'functional_areas.id')
         // 														 ->get([DB::raw('concat(industries.name, " - ", functional_areas.name) as name'), 'industry_functional_area_mappings.id as id']);
         // $industryfarearoleShow = Industry_functional_area_role_mapping::leftJoin('roles', 'industry_functional_area_role_mapping.role', '=', 'roles.id')
         // 															  ->get(['roles.name as name', $indfunctional]);
         return view('pages.adminUpdate', compact('title', 'skills', 'roles', 'functionalAreas', 'industry', 'indfunctionalMapping', 'rolesShow', 'faShow', 'industryShow', 'industryfareaShow', 'industryfarearoleShow'));
         // return $indfunctionalMapping;
     } else {
         return redirect('/home');
     }
 }
開發者ID:devvicky,項目名稱:Jobb-new,代碼行數:29,代碼來源:AdminController.php

示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $user = $this->users->findOrFail($id);
     $roles = Role::lists('name', 'id');
     return \View::make('admin.users.edit', ['user' => $user, 'roles' => $roles, 'title' => 'edit']);
 }
開發者ID:meccado,項目名稱:acl-admin-control-panel,代碼行數:12,代碼來源:UserController.php


注:本文中的app\Role::lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。