当前位置: 首页>>代码示例>>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;未经允许,请勿转载。