mysql - 按降序顺序从 Sentry 获取用户记录

标签 mysql laravel laravel-4 cartalyst-sentry

我想从 Laravel Sentry 包中获取用户记录。

此代码从数据库返回用户记录:

$customer = Sentry::findGroupByName('Users');
$customer = Sentry::findAllUsersInGroup($customer);
return View::make('admin.store.customer')->with('customer', $customer);

如何对用户记录进行降序排序?

最佳答案

你可以尝试:

Sentry::findAllUsersInGroup($customer)->count();

获取计数,并在添加循环后对它们进行排序。

关于mysql - 按降序顺序从 Sentry 获取用户记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33017033/

相关文章:

laravel - Homestead 多个网站无法正常工作

php - 允许 laravel 正常工作

MySQL - ORDER BY Rand() 总是给出相同的结果

mysql - ServiceStack.OrmLite : Inserting or updating columns that are not represented in the POCO?

mysql - 如何使用 Scope 在 Eloquent ORM 中选择除(A 和 B)以外的所有行?

mysql - SQL:应用程序跨数据库仅维护一种通用模式

php - 将 mysql 查询逻辑转换为 Laravel 查询生成器

mysql - 如何在 Laravel 中运行复杂的 sql 查询

php - Laravel 中间件以错误的顺序执行

php - 安装了 php71w-gd 并收到错误 GD Library extension not available with this PHP installation