Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.79 KB

2-Configuration.md

File metadata and controls

68 lines (47 loc) · 1.79 KB

3. Configuration

Table of contents

  1. Installation and Setup
  2. Configuration
  3. Usage

After you've published the config file config/hasher.php, you can customize the settings :

Defaults

return [
    
    /* -----------------------------------------------------------------
     |  Defaults
     | -----------------------------------------------------------------
     */
         
    'default'     => [
        'driver' => 'hashids',
        'option' => 'main',
    ],
    
    //..

You can set your default hashing driver and connection for your application.

Drivers

return [
    //...
    
    /* -----------------------------------------------------------------
     |  Drivers
     | -----------------------------------------------------------------
     */
     
    'drivers'     => [

        'hashids' => [
            'driver'  => Arcanedev\Hasher\Drivers\HashidsDriver::class,

            'options' => [
                'main' => [
                    'salt'     => env('HASHIDS_MAIN_SALT', ''),
                    'length'   => env('HASHIDS_MAIN_LENGTH', 0),
                    'alphabet' => env('HASHIDS_MAIN_ALPHABET', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'),
                ],

                //
            ],
        ],

    ],

    //...
];

The drivers attribute allows you to specify the supported drivers for your application and you can also create & add your own custom class & options.

The options attribute are options for your hashing driver, it may vary according to your driver.

You can also specify multiple connections for each driver, like main and alt, it allows you to hash each entity in your application to different hashing results.