leuverink / eloquent-hashid-binding
A drop in solution for eloquent route model binding with hashid's
Installs: 4 132
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- hashids/hashids: ^4.0
- illuminate/support: 5.5.* || 5.6.* || 5.7.* || 5.8.* || 6.* || 7.* || 8.* || 9.* || 10.*
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.26.2
- orchestra/testbench: ^3.8
- phpunit/phpunit: ^8.2
This package is auto-updated.
Last update: 2024-10-30 10:34:56 UTC
README
A drop in solution for eloquent implicit route model binding with hashid's.
Obfuscate your app's id's from prying eyes.
What this package does
This package obfuscates eloquent model's id's when used in url's. This is really usefull when you don't want to expose id's to the outside world.
The route keys are encoded/decoded on the fly. You can drop this in any Laravel project without the need for migrations.
Installation
composer require leuverink/eloquent-hashid-binding
Basic usage
Simply use the HashidBinding trait in your eloquent model and you're good to go!
namespace App; use Illuminate\Foundation\Auth\User as Authenticatable; use Leuverink\HashidBinding\HashidBinding; class User extends Authenticatable { use HashidBinding; // }
That's it! Check out the docs for more information.