Download the PHP package guidsen/fake-identifier without Composer

On this page you can find all versions of the php package guidsen/fake-identifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fake-identifier

With this little package you are able to transform your internal id's to obfuscated integers easily in Laravel and Lumen 5.1. The package is made on top of jenssegers/optimus and is similar to Hashids.
If you use this library and use the traits that comes with it, you will be able to get a hashed identifier by using the hashed_id attribute. So $model->hashed_id will contain you hashed id.
If you want to change the attribute name, you can have a look at the usage section.

Installation

Setup

The hashing algorithm depends on 3 integers.

You can calculate a prime number yourself, or pick one from this list.
Once you have selected a prime number, you can use the included console command to calculated the inverse prime that is used for the decoding process and generate a random integer:

Because the helpers depend on the container binding you will have to bind the instance to the container with the optimus key. This will look like (fill in your the values you just generated):

Usage

The library comes with two helper traits.
FakeIdentifier: This trait should be used in your model. This will add a attribute containing the hashed id.
FakeIdentifierHelper: This trait should be used in your controllers or base controller. It will contain a encode and decode method which could be usefull.

The attribute which will contain the hashed id, default to hashed_id. You can change this to your own favorite id by using the setAttributeName method on the Optimus instance in the container binding.


All versions of fake-identifier with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
jenssegers/optimus Version 0.1.*
illuminate/support Version 5.1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package guidsen/fake-identifier contains the following files

Loading the files please wait ...