本文整理汇总了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();
}
示例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) {
}
}
示例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'));
}
示例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'));
}
示例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'));
}
示例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);
}
示例7: __construct
public function __construct(User $model, Role $role)
{
parent::__construct();
$this->model = $model;
$this->roles = $role->lists('name', 'id');
}
示例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]);
}
示例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'));
}
示例10: getAllRolesList
public function getAllRolesList()
{
return Role::lists('name', 'id');
}
示例11: __construct
public function __construct()
{
$this->model = new User();
$this->roles = ['' => ''] + Role::lists('role', 'id')->toArray();
}
示例12: getRoles
protected function getRoles()
{
return Role::lists('display_name', 'id')->toArray();
}
示例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);
}
示例14: composeUserForm
private function composeUserForm()
{
view()->composer('admin.users.fields', function ($view) {
$view->with('roles', \App\Models\Role::lists('name', 'id'));
});
}
示例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');
}