本文整理汇总了PHP中Role::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::orderBy方法的具体用法?PHP Role::orderBy怎么用?PHP Role::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::orderBy方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Show the form for creating a new resource.
* GET /users/create
*
* @return Response
*/
public function create()
{
$pagetitle = 'Create User';
$departments = Department::orderBy('department')->lists('department', 'id');
$roles = Role::orderBy('name')->lists('name', 'id');
return View::make('user.create', compact('pagetitle', 'departments', 'roles'));
}
示例2: getLookup
static function getLookup()
{
$role = new Role();
$role->orderBy('name');
$role->find();
$roleList = array();
while ($role->fetch()) {
$roleList[$role->roleId] = $role->name . ' - ' . $role->description;
}
return $roleList;
}
示例3: permission_index
public function permission_index()
{
$president_id = Auth::user()->id;
$users = User::with('AssigmentRole')->with('Neighbors')->paginate(10);
$president_urbanism = Neighbors::with('NeighborProperty')->findOrFail($president_id);
foreach ($president_urbanism->NeighborProperty as $row) {
$urbanism_id = $row->urbanism_id;
$neighbors = NeighborProperty::where('urbanism_id', '=', $urbanism_id)->get();
}
$roles = Role::orderBy('id', 'ASC')->lists('name', 'id');
return View::make('dashboard.admin.permission.index', ['select' => ['' => 'Seleccione'], 'neighbors' => $neighbors, 'roles' => $roles, 'users' => $users]);
}
示例4: getView
public function getView($id)
{
User::onlyHas('user-edit');
$this->data['user'] = User::find($id);
$this->data['roles'] = Role::orderBy('key', 'asc')->get();
if ($this->data['user']) {
$this->layout->content = View::make('sections.user.view', $this->data);
return $this->layout;
} else {
throw new Exception("User not found");
}
}
示例5: getRolePermission
/**
* get the Filemanager
*
* @return Response
*/
public function getRolePermission()
{
//User
$data['user'] = Auth::user();
//Roles
$data['roles'] = Role::orderBy('name', 'ASC')->get();
//Interface
$data['noAriane'] = true;
if (Request::ajax()) {
return Response::json(View::make('theme::' . 'admin.role_permission.index', $data)->renderSections());
} else {
return View::make('theme::' . 'admin.role_permission.index', $data);
}
}
示例6: _list
public function _list($page = 1, $searchString = null)
{
if (!empty($searchString)) {
$roles = Role::where('ime', 'like', '%' . $searchString . '%')->orderBy('ime');
} else {
$roles = Role::orderBy('ime');
}
if ($page != 1) {
Paginator::setCurrentPage($page);
}
$roles = $roles->paginate(10);
$v = View::make('Role.list')->with('roles', $roles);
if (Request::ajax()) {
return $v->renderSections()['list'];
}
return $v;
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$roles = Role::orderBy('name')->get();
return View::make("admin.role.list", array("roles" => $roles));
}
示例8: manageprivilleges
public static function manageprivilleges($id)
{
$pagetitle = 'Update User Role';
$user_id = $id;
$selectrole = DB::table('assigned_roles')->where('user_id', $id)->first();
$myrole = DB::table('roles')->where('id', $selectrole->role_id)->first();
$roles = Role::orderBy('name')->where('id', '!=', $myrole->id)->lists('name', 'id');
return View::make('user.roleedit', compact('pagetitle', 'myrole', 'roles', 'user_id'));
}
示例9: registro
public function registro()
{
$perfiles = Role::orderBy('name')->get();
$this->array_view['perfiles'] = $perfiles;
return View::make($this->folder_name . '.registro', $this->array_view);
}
示例10: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit(General $general, User $user)
{
$theme = $general->theme();
if ($user->id == Auth::user()->id) {
return redirect('/admin/user/' . $user->id);
}
dd($user);
$roles = Role::orderBy('level')->lists('name', 'id');
$theme['title'] = 'Edit User';
$theme['description'] = 'edit user entry';
$button_text = 'Update User';
return view('admin.group.edit', compact('theme', 'group', 'roles', 'button_text'));
}
示例11: getRolesOrdered
public static function getRolesOrdered($pagination = 10)
{
return Role::orderBy('id', 'desc')->paginate($pagination);
}