Download the PHP package naabster/laravel-eloquent-hashids without Composer

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

Laravel 5 Eloquent Hashids

Laravel 5 Eloquent Model trait for automatically generating and persistently saving Hashids for new models.
Uses @vinkla's Laravel 5 Hashids package.

Latest Stable Version License

Installation

Require this package, with Composer, in the root directory of your project.

You should first install @vinkla's Laravel 5 Hashids package according to their installation instructions.

Usage

Use the EloquentHashids trait on your model:

Configuration

By default the following configuration is used:

Hashids Connection

The default Hashids Connection is table.<tablename>, so for example for the Book model it would be table.books. You can set a different connection for your model with static::getHashidConnection():

Make sure you set your connections in your config/hashids.php config file (comes with @vinkla's Laravel 5 Hashids package)!

Column Name

By default the Hashid column is named uid. You can set a different column name for your model with static::getHashidColumn():

Attention

This package generates Hashids for new models and saves them to a column in your database table! To be able to do that, this column must exist in your table.
You should add this column to your model with a database migration.

Encoding Value

By default the Value/Number for your Hashid is the primary Key attribute of your model (defaults to id). You can adjust that any way you want, just make sure it is Hashids compatible. Just return another value from static::getHashidEncodingValue():

Example

In this example we generate Hashids with the connection bookHashids, for column hashid and with an encoding value of an array:

License

The Laravel 5 Eloquent Hashids package is open-sourced software licensed under the MIT license.


All versions of laravel-eloquent-hashids with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/database Version ^5.1.0
vinkla/hashids Version ^3.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 naabster/laravel-eloquent-hashids contains the following files

Loading the files please wait ....