Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gwleuverink/eloquent-hashid-binding
A drop in solution for implicit route model binding with hashid's
https://github.com/gwleuverink/eloquent-hashid-binding
composer hashids laravel route-model-binding
Last synced: 23 days ago
JSON representation
A drop in solution for implicit route model binding with hashid's
- Host: GitHub
- URL: https://github.com/gwleuverink/eloquent-hashid-binding
- Owner: gwleuverink
- License: mit
- Created: 2019-07-08T10:52:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T09:34:27.000Z (6 months ago)
- Last Synced: 2024-09-14T01:27:23.039Z (about 2 months ago)
- Topics: composer, hashids, laravel, route-model-binding
- Language: PHP
- Size: 185 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
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.
| **EXAMPLE** | |
| ----------- | ------------------------- |
| Before | `domain.test/users/1` |
| After | `domain.test/users/rvBVv` |---
## Installation
`composer require leuverink/eloquent-hashid-binding`
## Basic usage
Simply use the HashidBinding trait in your eloquent model and you're good to go!
``` php
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](https://gwleuverink.github.io/eloquent-hashid-binding/) for more information.