eloquent-hashids icon indicating copy to clipboard operation
eloquent-hashids copied to clipboard

Fetch from multiple hashids

Open ignacio-dev opened this issue 1 year ago • 0 comments

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();

ignacio-dev avatar May 17 '23 13:05 ignacio-dev