1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-04 15:17:28 +02:00

Document in README how to retrieve a list of all registered users

This commit is contained in:
Marco
2020-03-19 18:52:24 +01:00
parent 1757ad3fd1
commit d8847fb197

View File

@@ -919,6 +919,16 @@ catch (\Delight\Auth\AmbiguousUsernameException $e) {
} }
``` ```
#### Retrieving a list of registered users
When fetching a list of all users, the requirements vary greatly between projects and use cases, and customization is common. For example, you might want to fetch different columns, join related tables, filter by certain criteria, change how results are sorted (in varying direction), and limit the number of results (while providing an offset).
Thats why its easier to use a single custom SQL query. Start with the following:
```sql
SELECT id, email, username, status, verified, roles_mask, registered, last_login FROM users;
```
#### Assigning roles to users #### Assigning roles to users
```php ```php