PHP code example of alexanderzon / laravel-hashids

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

    

alexanderzon / laravel-hashids example snippets


'AlexanderZon\Hashids\HashidsServiceProvider'

Hashids::encode(1); // Returns Ri7Bi

Hashids::encode(1, 21, 12, 12, 666); // Returns MMtaUpSGhdA

Hashids::decode(Ri7Bi);

// Returns
int 1

Hashids::decode(MMtaUpSGhdA);

// Returns
array (size=5)
0 => int 1
1 => int 21
2 => int 12
3 => int 12
4 => int 666