eloquent-hashids
eloquent-hashids copied to clipboard
Fetch from multiple hashids
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();