veelasky / laravel-hashid Goto Github PK
View Code? Open in Web Editor NEWHashId Implementation on Laravel Eloquent ORM
License: MIT License
HashId Implementation on Laravel Eloquent ORM
License: MIT License
Hi
from what I can see, it seems impossible to migrate from v1 to v2, as v2 dropped the functionality to make reproducable keys? But maybe i just don't see how to do it...
So, in version one, we had the functionality to have a user-defined salt-generator by using makeHashedIdSalt()
on each model. With this is was possible to replace the generic, laravel-key-based salt and use reproducable salts. But now, this method was removed and it was hardcoded in Repository::get() without any way of custimization. Is that correct?
Why this is an issue:
Assume you have an URL /device/MyH4sh1D
stored to your bookmarks, as this is your personal device and you check it occasionally. Now a dev upgrades the package, which will change the "salt-generator", and ultimately, every link to your application is broken. This also applies for example if mails with a link were sent out or if the user somewhat stores the HashId somewhere.
Is it possible to have the same Hash IDs in different Laravel projects?
I set $hashKey on the models in the two different projects to be the same, but the hash IDs are different.
When I put the same APP_KEY for both projects, the hash IDs match, but obviously this is not practical.
Hi
When the hash string is invalid, an Illuminate\Database\QueryException
throws via the byHashOrFail method. It supposed to have a not found exception.
Hi
When the hash string is invalid, an Illuminate\Database\QueryException
throws via the byHash
method. It supposed to return a null
value.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.