Downloads
Stars
Version
Used vinkla/hashids package to create hash id.
Require this package, with Composer, in the root directory of your project.
$ composer require akr4m/hashid
Laravel Hashids requires connection configuration. To get started, you'll need to publish all vendor assets:
$ php artisan vendor:publish --provider=akr4m\hashid\HashIdServiceProvider
This will create a config/hashids.php
file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
This option default
is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is main
.
This option connections
is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like.
To add hash_id field on table in migration file, put this line
$table->hashid();
Ready to migrate now!!
And add some code on models like this
use akr4m\hashid\Traits\UsesHashIds;
class abc extends Model
{
use UsesHashIds;
}
This package is dedicated to Alext Garret