GithubHelp home page GithubHelp logo

veelasky / laravel-hashid Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 16.0 437 KB

HashId Implementation on Laravel Eloquent ORM

License: MIT License

PHP 100.00%
hashid laravel hashids laravel-hashid eloquent hash hashing hacktoberfest

laravel-hashid's Introduction

Live long and prosper! ๐Ÿ––

laravel-hashid's People

Contributors

codacy-badger avatar dependabot[bot] avatar eribloo avatar jonhassall avatar kohlerdominik avatar mondotosz avatar muhajirinlpu avatar nathollings avatar pyaesoneaungrgn avatar stylecibot avatar vctrtvfrrr avatar veelasky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

laravel-hashid's Issues

Impossible Migration to v2?

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.

Use the same hashIds between projects

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.

Wrong exception on invalid hash string

Hi
When the hash string is invalid, an Illuminate\Database\QueryException throws via the byHashOrFail method. It supposed to have a not found exception.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.