当前位置: 首页>>代码示例>>PHP>>正文


PHP Role::lists方法代码示例

本文整理汇总了PHP中app\models\Role::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::lists方法的具体用法?PHP Role::lists怎么用?PHP Role::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Role的用法示例。


在下文中一共展示了Role::lists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(User $model)
 {
     parent::__construct();
     $this->titleAction = 'User';
     $this->model = $model;
     $this->roles = Role::lists('name', 'id')->toArray();
 }
开发者ID:julles,项目名称:sociolla,代码行数:7,代码来源:UserController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     try {
         $user = User::findOrFail($id);
         $roles = Role::lists('title', 'id');
         return view('admin.users.edit', compact('user', 'roles'));
     } catch (Exception $e) {
     }
 }
开发者ID:doankhoi,项目名称:Application,代码行数:15,代码来源:UserController.php

示例3: CrudAdmin

 public function CrudAdmin()
 {
     $options = array(1 => 'Si', 0 => 'No');
     $edit = DataEdit::source(new User());
     $edit->link("/administracion/lista", "Lista Administración", "TR")->back();
     $edit->add('name', 'Nombre', 'text')->rule('required');
     $edit->add('email', 'Email', 'text')->rule('required');
     $edit->add('roles', 'Roles', 'checkboxgroup')->options(Role::lists('display_name', 'id')->all());
     $edit->add('imagen_perfil', 'Imagen', 'image')->rule('mimes:jpeg,png')->move('uploads/users_images/');
     $edit->add('cuenta_activa', 'Activo', 'select')->options($options);
     return $edit->view('administracion/crud', compact('edit'));
 }
开发者ID:davila7,项目名称:kayra,代码行数:12,代码来源:AdministracionController.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $roles = Role::lists('name', 'id');
     return view('gertjanroke.usermanager.users.edit', compact('user', 'roles'));
 }
开发者ID:gertjanroke,项目名称:users,代码行数:12,代码来源:UsersController.php

示例5: edit

 /**
  * Show the form for editing the specified User.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $user = $this->userRepository->findWithoutFail($id);
     if (empty($user)) {
         Flash::error('User not found');
         return redirect(route('users.index'));
     }
     $roles = Role::lists('name', 'id');
     if ($user->role()) {
         $user->role_id = $user->role()->id;
     }
     return view('users.edit', compact('user', 'roles'));
 }
开发者ID:sagaciresearch,项目名称:adtracking,代码行数:20,代码来源:UserController.php

示例6: edit

 public function edit(User $user)
 {
     $roles = Role::lists('name', 'id');
     return view('backend.users.edit')->with('user', $user)->with('statuses', User::getStatuses())->with('roles', $roles);
 }
开发者ID:AlexYaroma,项目名称:mightyducks,代码行数:5,代码来源:UsersController.php

示例7: __construct

 public function __construct(User $model, Role $role)
 {
     parent::__construct();
     $this->model = $model;
     $this->roles = $role->lists('name', 'id');
 }
开发者ID:julles,项目名称:gis,代码行数:6,代码来源:UserController.php

示例8: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Redirect
  * @param  $club-slug or $club-id
  */
 public function create($slug)
 {
     $roles = Role::lists('name', 'id');
     $club = getClub($slug, 'admin::clubs');
     return view('clubs.roles.create', ['club' => $club, 'roles' => $roles]);
 }
开发者ID:bde42,项目名称:website_v2_laravel,代码行数:12,代码来源:ClubRoleController.php

示例9: CrudAlumno

 public function CrudAlumno()
 {
     $options = array(1 => 'Si', 0 => 'No');
     $estados = array('activo' => 'Activo', 'congelado' => 'Congelado', 'suspendido' => 'Suspendido', 'prueba' => 'Prueba', 'inactivo' => 'Inactivo');
     $edit = DataEdit::source(new User());
     $edit->link("/alumnos/lista", "Lista Alumnos", "TR")->back();
     $edit->add('name', 'Nombre', 'text')->rule('required');
     $edit->add('last_name', 'Apellido', 'text')->rule('required');
     $edit->add('email', 'Email', 'text')->rule('required');
     $edit->add('cuenta_activa', 'Activo', 'select')->options($options);
     $edit->add('estado', 'Estado', 'select')->options($estados);
     $edit->add('pago_email', 'Habilitar pago por Email', 'select')->options($options);
     $edit->add('roles', 'Roles', 'checkboxgroup')->options(Role::lists('display_name', 'id')->all());
     $edit->add('imagen_perfil', 'Imagen', 'image')->rule('mimes:jpeg,png')->move('uploads/users_images/');
     $edit->add('fecha_registro', 'Fecha Inscripción', 'date')->format('d/m/Y', 'es')->rule('required');
     return $edit->view('alumnos/crud', compact('edit'));
 }
开发者ID:davila7,项目名称:kayra,代码行数:17,代码来源:AlumnosController.php

示例10: getAllRolesList

 public function getAllRolesList()
 {
     return Role::lists('name', 'id');
 }
开发者ID:lufias,项目名称:L5admin,代码行数:4,代码来源:RoleRepository.php

示例11: __construct

 public function __construct()
 {
     $this->model = new User();
     $this->roles = ['' => ''] + Role::lists('role', 'id')->toArray();
 }
开发者ID:julles,项目名称:laramin,代码行数:5,代码来源:UserController.php

示例12: getRoles

 protected function getRoles()
 {
     return Role::lists('display_name', 'id')->toArray();
 }
开发者ID:hramose,项目名称:laravel-5-admin,代码行数:4,代码来源:UserForm.php

示例13: edit

 public static function edit($id)
 {
     $user = User::find($id);
     if (!$user) {
         return redirect()->back()->withErrors('No se encontro el usuario solicitado');
     }
     $states = State::lists('name', 'id');
     $cities = City::lists('name', 'id');
     $roles = Role::lists('name', 'id');
     $data = ["user" => $user, "states" => $states, "cities" => $cities, "roles" => $roles];
     return view('users.edit')->with($data);
 }
开发者ID:mauhftw,项目名称:mizustats,代码行数:12,代码来源:UsersController.php

示例14: composeUserForm

 private function composeUserForm()
 {
     view()->composer('admin.users.fields', function ($view) {
         $view->with('roles', \App\Models\Role::lists('name', 'id'));
     });
 }
开发者ID:jclyons52,项目名称:mycourse-rocks,代码行数:6,代码来源:ViewComposerServiceProvider.php

示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $user = Sentinel::findUserById($id);
     $userRoles = $user->getRoles()->lists('name', 'id')->toArray();
     $roles = Role::lists('name', 'id');
     return view('backend.user.edit', compact('user', 'roles', 'userRoles'))->with('active', 'user');
 }
开发者ID:phillipmadsen,项目名称:app,代码行数:13,代码来源:UserController.php


注:本文中的app\models\Role::lists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。