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

Commit

Permalink
Merge pull request #49 from mattdfloyd/master
Browse files Browse the repository at this point in the history
Implement mapIds()
  • Loading branch information
msonowal authored Oct 16, 2018
2 parents 6af05ef + c840a1b commit fc2418d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Engines/MySQLEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ public function delete($models)
{
}

/**
* Pluck and return the primary keys of the given results.
*
* @param mixed $results
* @return \Illuminate\Support\Collection
*/
public function mapIds($results)
{
return collect($results['results'])->map(function ($result) {
return $result->getKey();
});
}

/**
Expand Down

0 comments on commit fc2418d

Please sign in to comment.