You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick and dirty port of the [Facebook's DataLoader](https://github.com/facebook/dataloader) to PHP
2
+
Quick port of the [Facebook's DataLoader](https://github.com/facebook/dataloader) to PHP. Async superpowers from [ReactPHP](https://github.com/reactphp)
3
3
4
4
## Todo
5
5
-[x] Primary API
6
6
-[x] Error / rejected promise handling
7
7
-[x] Options support
8
8
-[x] Abuse tests and meaningful exceptions
9
-
-[ ] Documentation for the API
9
+
-[ ] Documentation for the API and usage examples
10
10
-[ ] Abstract event loop and promises to be usable with any implementation?
11
+
12
+
## Usage with common ORM's
13
+
14
+
### Eloquent (Laravel)
15
+
16
+
```php
17
+
$userByIdLoader = new DataLoader(function ($ids) {
18
+
$users = User::findMany($ids);
19
+
20
+
// Make sure that the users are on the same order as the given ids
21
+
$orderedUsers = collect($ids)->map(function ($id) use ($users) {
0 commit comments