Download the PHP package matt-daneshvar/eloquent-hashids without Composer

On this page you can find all versions of the php package matt-daneshvar/eloquent-hashids. 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 eloquent-hashids

Eloquent Hashids for Laravel

Build Status GitHub

Automatically persist Hashids on your newly created Eloquent models using Ivan Akimov's Hashids library.

This can be useful when you need to generate unique alphanumeric (or any other character) combinations to represent your models.

Installation

Require the package using composer.

Usage

Add a nullable hashid column to your database table in your migrations.

Use the Hashid trait to automatically generate and persist Hashids for your new models. Optionally use HashidRouting to set your model to use the hashid column for Laravel's Route Model Binding.

Customizing Hashid generation

While the package attempts to use sensible defaults to minimize configuration out of the box, you're free to adjust the Hashid generation behaviour using static properties on your model definition.

Changing the Hashid column

To customize the hashid column, set your own custom $hashidColumn value on your model.

Changing the salt

Each model's table name is by default used as the salt for generating Hashids. With that, models of separate classes that share the same IDs (e.g. a Task model with ID of 1 and a Receipt model also with ID of 1) would each have different Hashids. You may change this behaviour and override the salt by specifying the $hashidSlat on your model.

Creating your own Hashids instance

To fully customize the behaviour of the underlying Hashids library, you may also define your own Hashids instance in your model's boot method. Note that your Hashids instance would take precedence over all other customizations, and therefore all the rest of the static Hashid properties on your model (i.e. $hashidMinLength, $hashidChars, etc.) would be ignored once you specify your own Hashids instance.

Using the HashidRouting trait

A common use case of Hashids with Eloquent models is to use short URLs using the generated Hashids as identifiers.

For example you may wish to represent your app's receipts using their Hashid values:

instead of their IDs:

For more convenience this package comes with a HashidRouting trait out of the box; once added to your model, this trait will change the model's route key name to its corresponding Hashid column, which would allow you to take advantage of Laravel's Route Model Binding and use the Hashid URLs:

License

The MIT License (MIT). Please see License File for more information.


All versions of eloquent-hashids with dependencies

PHP Build Version
Package Version
Requires hashids/hashids Version ^4.0

The package matt-daneshvar/eloquent-hashids contains the following files

Loading the files please wait ....