vinkla / laravel-hashids

A Hashids bridge for Laravel
MIT License
2k stars 173 forks source link

Decode not working #130

Closed grsherwin closed 4 years ago

grsherwin commented 4 years ago

The encode works great, but get this message when trying to decode....htmlspecialchars() expects parameter 1 to be string, array given Code is this... $hashids = Hashids::encode(1); $numbers = Hashids::decode($hashids);

It also fails if I do this... $hashids = Hashids::encode(1); $numbers = Hashids::decode('JR'); with the same error message.... htmlspecialchars() expects parameter 1 to be string, array given

GrahamCampbell commented 4 years ago

This is correct. Decode returns an array. Please read the docs.