Package Data | |
---|---|
Maintainer Username: | seguce92 |
Maintainer Contact: | seguce92@gmail.com (Sergio Gualberto Cruz Espinoza) |
Package Create Date: | 2017-05-02 |
Package Last Update: | 2019-06-25 |
Home Page: | http://mascodigo.net |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-11 15:21:59 |
Package Statistics | |
---|---|
Total Downloads: | 199 |
Monthly Downloads: | 4 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
$ composer require seguce92/laravel-hashid
Add service provider in 'config/app.php'
'providers' => [
...
Seguce92\LaravelHashid\ServiceProvider::class,
...
],
Add alias in 'config/app.php' (optionnal)
'aliases' => [
...
'Hashid' => Seguce92\LaravelHashid\Facade::class,
...
],
Publish configuration
$ php artisan vendor:publish
/**
* Min lenght of generated Hashid
*/
'min_lenght' => 8,
/*
* Alphabet use in Hashid generation
*/
'alphabet' => 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789',
// without custom value salt (default is app key and 'laravel-hashid')
$hashid = Hashid::encode($id); // return string
$id = Hashid::decode($hasid); // return integer
// with custom value salt
$hashid = Hashid::encode($id, $salt); // return string
$id = Hashid::decode($hasid, $salt); // return integer