Joined January 2013
·

tbleckert

Webdeveloper at Self employed
·
Stockholm
·
·
·

Posted to Laravel hidden ID over 1 year ago

Cool, glad you like it. Another use case for using hashids is when you have an action that requires multiple id's, like making a relation between two resources. Imagine this url relation/create/1/2. Instead of exposing those two ID's and using only 1 token instead of two ID's, you can use Hashids like so: $token = Hashids::encrypt($first->id, $second->id); // wguB. And when you decrypt it you would get an array of the two ID's. I just need to find out a nice way the integrate it with Laravel.

Achievements
100 Karma
4,992 Total ProTip Views