本文整理汇总了PHP中Role::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::lists方法的具体用法?PHP Role::lists怎么用?PHP Role::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::lists方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$user = $this->user->find($id);
if (is_null($user)) {
return Redirect::route('users.index');
}
$role_options = Role::lists('role_name', 'id');
return View::make('users.edit', compact('user', 'role_options'));
}
示例2: users
public function users()
{
$users = \User::all();
$deleted_users = \User::onlyTrashed()->lists('username', 'id');
$suspended_users = \Throttle::where('suspended', 1)->count();
$banned_users = \Throttle::where('banned', 1)->lists('user_id', 'user_id');
$users_list = \User::all()->lists('username', 'id');
$roles_list = \Role::lists('name', 'id');
return \View::make('admin.users', compact('users', 'deleted_users', 'suspended_users', 'users_list', 'banned_users', 'roles_list'));
}
示例3: editUserView
public function editUserView($username)
{
if (User::where('username', $username)->exists()) {
$roles = Role::lists('name', 'id');
$user = User::where('username', $username)->first();
return View::make('admin.edituser')->with(['user' => $user, 'roles' => $roles]);
}
App::abort(404);
//TODO: Add Error Message(There is no user found by given username)
}
示例4: employee
public function employee()
{
$ids = DB::table('tblEmployees')->select('strEmpID')->orderBy('updated_at', 'desc')->orderBy('strEmpID', 'desc')->take(1)->get();
$ID = $ids["0"]->strEmpID;
$newID = $this->smart($ID);
$ids2 = DB::table('tblLogin')->select('strUsername')->orderBy('strUsername', 'desc')->take(1)->get();
$ID2 = $ids2["0"]->strUsername;
$newID2 = $this->smart($ID2);
// Get all products from the database
$employees = Employee::all();
$branches = Branch::lists('strBrchName', 'strBrchID');
$roles = Role::lists('strRoleDescription', 'strRoleID');
$data = array('employees' => $employees, 'branches' => $branches, 'roles' => $roles);
return View::make('employee')->with('data', $data)->with('newID', $newID)->with('newID2', $newID2);
}
示例5: edit
public function edit($id)
{
$user = User::find($id);
$status = ['1' => 'Aktif', '0' => 'Tidak Aktif'];
$roles = Role::lists('name', 'id');
return View::make('users.edit', compact('user', 'roles', 'status'));
}
示例6: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$roles_data = Role::lists("name", "id");
return View::make('admin.user.create_invitation')->with('roles_data', $roles_data);
}
示例7: anyCreate
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function anyCreate()
{
$roles = Role::lists('name', 'id');
return $this->render('users.create', compact('cont', 'roles'));
}
示例8: filterRoles
public function filterRoles()
{
if ($this->role->role == 'All') {
$ec = Role::lists('role', 'id');
} else {
$ec = Role::where('role', '<>', 'All')->lists('role', 'id');
}
return $ec;
}
示例9: getAddroleindex
/**
* @param $id
* @return \Illuminate\View\View
*/
public function getAddroleindex($id)
{
$person = People::findOrFail($id);
$roles = Role::lists('name_rol', 'id');
$branches = Branch::lists('name', 'id');
return view('admin.addroles.addrole', compact('person', 'roles', 'branches'));
}
示例10: edit
/**
* Show the form for editing the specified post.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
if (Auth::user()->role_id == 3 and Auth::user()->id != $id) {
$user = User::find(Auth::user()->id);
$roles = Role::lists('nombre', 'id');
return View::make('users.edit', compact('user'))->with('roles', $roles);
} else {
$user = User::find($id);
$roles = Role::lists('nombre', 'id');
return View::make('users.edit', compact('user'))->with('roles', $roles);
}
}