當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。