Created
February 6, 2017 17:09
-
-
Save joetannenbaum/15552c8cb0730ab355048e86f42ae1f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Hashids\Hashids; | |
class Hasher | |
{ | |
public static function encode(...$args) | |
{ | |
return app(Hashids::class)->encode(...$args); | |
} | |
public static function decode($enc) | |
{ | |
if (is_int($enc)) { | |
return $enc; | |
} | |
return app(Hashids::class)->decode($enc)[0]; | |
} | |
} |
You put the Hasher.php in your App folder. The documentation is poor.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome, can you tell me where to create hasher class?.