1. Go to this page and download the library: Download alexander-fuchs/hashidable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
alexander-fuchs / hashidable example snippets
use Altinum\Hashidable\Hashidable;
Class User extends Model
{
use Hashidable;
}
public function show(Request $request, User $user)
{
return $user; // Works just fine
}
return [
/**
* Length of the generated hashid.
*/
'length' => 16,
/**
* Character set used to generate the hashids.
*/
'charset' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
/**
* Prefix attached to the generated hash.
*/
'prefix' => '',
/**
* Suffix attached to the generated hash.
*/
'suffix' => '',
/**
* If a prefix of suffix is defined, we use this as a separator
* between the prefix/suffix.
*/
'separator' => '-',
];
public function hashidableConfig()
{
return ['prefix' => 'app'];
}