PHP code example of specs / hashids-laravel

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

    

specs / hashids-laravel example snippets


'providers' => array(

    Illuminate\Validation\ValidationServiceProvider::class,
    ...
    Illuminate\View\ViewServiceProvider::class,

    Specs\Hashids\HashidsServiceProvider::class,
),

'aliases' => array(

    'App' => Illuminate\Support\Facades\App::class,
    ...
    'View' => Illuminate\Support\Facades\View::class,

    'Hashids' => Specs\Hashids\HashidsFacade::class,

),

$id = Hashids::encode(1, 2, 3);
$numbers = Hashids::decode($id);

var_dump($id, $numbers);
bash
php artisan vendor:publish --tag=config