Domanda

Anybody know how to get limited number of sentry users. I have admin panel in my laravel application and I make a user management. For display data (groups table, user table, permission table, ...) I use jqgrid. So if I have half million users I want to get limited list of users with specific data.

For use limitation in Laravel, I use standard function skip and take, but I cannot use these method on Sentry findAllUsers().

What solution is the best in this case?

È stato utile?

Soluzione

There are some ways, one of them is to get an empty Sentry user model, which is based on Eloquent:

$model = Sentry::getUserProvider()->getEmptyUser();

And use it as you would with Eloquent:

$all = $model->all();

$paginated = $model->paginate();

$selected = $model->where('age', '<', 21)->get();
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top