當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Role::lists方法代碼示例

本文整理匯總了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'));
 }
開發者ID:hendryguna,項目名稱:laravel-basic,代碼行數:15,代碼來源:UsersController.php

示例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'));
 }
開發者ID:pogliozzy,項目名稱:larabase,代碼行數:10,代碼來源:UsersController.php

示例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)
 }
開發者ID:Acikteknoloji,項目名稱:acikteknoloji,代碼行數:10,代碼來源:AdminController.php

示例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);
 }
開發者ID:ExperimentalGroup,項目名稱:inventoryfinal,代碼行數:15,代碼來源:HomeController.php

示例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'));
 }
開發者ID:arbuuuud,項目名稱:gnt-aops,代碼行數:7,代碼來源:UsersController.php

示例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);
 }
開發者ID:mertindervish,項目名稱:registerbg,代碼行數:10,代碼來源:AdminInvitationController.php

示例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'));
 }
開發者ID:ryzr,項目名稱:bootlegcms,代碼行數:10,代碼來源:UsersController.php

示例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;
 }
開發者ID:amcfarlane1251,項目名稱:lcnsMgmt,代碼行數:9,代碼來源:User.php

示例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'));
 }
開發者ID:EstebanJesus,項目名稱:bancopedagogico-v2,代碼行數:11,代碼來源:PeopleTraits.php

示例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);
     }
 }
開發者ID:awdesarrollos,項目名稱:appshop,代碼行數:18,代碼來源:UsersController.php


注:本文中的Role::lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。