mtvs / eloquent-hashids

On-the-fly hashids for Laravel Eloquent models. (🍰 Easy & ⚡ Fast)
292 stars 21 forks source link

Fetch from multiple hashids #28

Open ignacio-dev opened 1 year ago

ignacio-dev commented 1 year ago

Is it possible to get() from an array of hashids?

Or perhaps access the hashidToId() method statically?

At the moment I am having to do:

$ids = [];

foreach ($hashids as $hashid) {
    array_push($ids, (new Product)->hashidToId($hashid));
}

return Product::whereIn('id', $ids)->get();