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


PHP Permission::orderBy方法代碼示例

本文整理匯總了PHP中app\Permission::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Permission::orderBy方法的具體用法?PHP Permission::orderBy怎麽用?PHP Permission::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Permission的用法示例。


在下文中一共展示了Permission::orderBy方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAllPermissions

 /**
  * @param string $order_by
  * @param string $sort
  * @param bool $withRoles
  * @return mixed
  */
 public function getAllPermissions($order_by = 'id', $sort = 'asc', $withRoles = true)
 {
     if ($withRoles) {
         return Permission::with('roles')->orderBy($order_by, $sort)->get();
     }
     return Permission::orderBy($order_by, $sort)->get();
 }
開發者ID:num3thod,項目名稱:laravel-5-boilerplate,代碼行數:13,代碼來源:EloquentPermissionRepository.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $this->authorize('roles-edit');
     $role = Role::with('permissions')->findOrFail($id);
     $permissions = Permission::orderBy('display_name')->get();
     return view('roles.edit', compact('permissions', 'role'));
 }
開發者ID:guenthertheilen,項目名稱:laravel-boilerplate,代碼行數:13,代碼來源:RolesController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $menus = Menu::all();
     $permissions = Permission::orderBy('updated_at', 'desc')->get();
     //echo '<pre>';
     //print_r($permissions);
     return view('permission.index')->with(array('menus' => $this->menus, 'permissions' => $permissions));
 }
開發者ID:thaigialai1987,項目名稱:qlcv,代碼行數:13,代碼來源:PermissionController.php

示例4: role

 public function role()
 {
     $roles = Role::with('perms')->get();
     $perms = Permission::orderBy('name')->get();
     $roles_json = $roles->toArray();
     $data = compact('roles', 'perms', 'roles_json');
     // dd($data);
     return view('user.role', $data);
 }
開發者ID:ibnoe,項目名稱:trustline,代碼行數:9,代碼來源:UserController.php

示例5: getSorted

 public function getSorted()
 {
     $permissions = Permission::orderBy('name')->get();
     $sorted = [];
     foreach ($permissions as $permission) {
         $modelname = substr($permission->name, 0, strrpos($permission->name, '_'));
         if (!array_key_exists($modelname, $sorted)) {
             $sorted[$modelname] = [];
         }
         array_push($sorted[$modelname], ['name' => $permission->name, 'id' => $permission->id, 'label' => substr($permission->name, strrpos($permission->name, '_') + 1)]);
     }
     return $sorted;
 }
開發者ID:manogi,項目名稱:gfw-qm,代碼行數:13,代碼來源:EloquentPermissionRepository.php

示例6: getAllPermissionsPaginated

 public static function getAllPermissionsPaginated($pages)
 {
     return Permission::orderBy("permission_name", "ASC")->paginate($pages);
 }
開發者ID:gpawlik,項目名稱:laravel-projects-codebase,代碼行數:4,代碼來源:PermissionRepository.php

示例7: orderBy

 public function orderBy($column)
 {
     return \App\Permission::orderBy($column)->get();
 }
開發者ID:crow1796,項目名稱:technologyRIS,代碼行數:4,代碼來源:PermissionRepository.php

示例8: index

 /**
  * permission list
  * @return view
  */
 public function index()
 {
     $list = Permission::orderBy('id', 'desc')->paginate(config('shop.pagesize'));
     return view('admin.permission.index', compact('list'));
 }
開發者ID:Jokeramc,項目名稱:amc,代碼行數:9,代碼來源:PermissionController.php

示例9: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = $this->user->find($id);
     $branch = $this->branch->where('id', '!=', 1)->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'))->orderBy('name', 'asc')->lists('name', 'id');
     $perms = Permission::orderBy('name', 'asc')->lists('display_name', 'id');
     return view('user.edit', compact('user', 'branch', 'perms'));
 }
開發者ID:sahilbhatt92,項目名稱:transpt,代碼行數:13,代碼來源:UserController.php


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