Laravel

Laravel hashid

Hashid is a Laravel package, which encode/decode id of Laravel model and get hashed/unhashed version.

It is useful when we want to hide the actual id of db object so that users don’t know the real id.

composer require vinkla/hashids
php artisan vendor:publish

This will create a config/hashids.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

Hashids::encode(4815162342);
Hashids::decode('doyouthinkthatsairyourebreathingnow');

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *