PHP code example of sungmee / laravel-hashid

1. Go to this page and download the library: Download sungmee/laravel-hashid 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/ */

    

sungmee / laravel-hashid example snippets


'providers' => [
    Sungmee\Hashid\HashidServiceProvider::class,
]

'aliases' => [
    'Hashid' => Sungmee\Hashid\Facades\Hashid::class,
]

use Sungmee\Hashid\Facades\Hashid;

$id   = 123;

$hash = Hashid::hash($id); // 2LtLgHkF
$id   = Hashid::id($hash); // 123

$id   = 123;

$hash = \Hashid::hash($id); // 2LtLgHkF
$id   = \Hashid::id($hash); // 123