Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit c840a1b

Browse files
authored
Implement mapIds()
1 parent 506cff6 commit c840a1b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Engines/MySQLEngine.php

+9
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ public function delete($models)
2727
{
2828
}
2929

30+
/**
31+
* Pluck and return the primary keys of the given results.
32+
*
33+
* @param mixed $results
34+
* @return \Illuminate\Support\Collection
35+
*/
3036
public function mapIds($results)
3137
{
38+
return collect($results['results'])->map(function ($result) {
39+
return $result->getKey();
40+
});
3241
}
3342

3443
/**

0 commit comments

Comments
 (0)