PHP code example of mozafar / encbuddy

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

    

mozafar / encbuddy example snippets


protected $middleware = [
    .
    .
    .,
    \Mozafar\EncBuddy\EncBuddyMiddleware::class,
];

Route::encryption();

namespace Your\Name\Space;

class MyKeyResolver implements KeyResolverInterface
{
    public function key(): string
    {
        return 'My custom key';
    }
}

/*
|--------------------------------------------------------------
| Custom class to get key and cipher
|--------------------------------------------------------------
| If set this config to null then constant key will
| be used
*/
'custom_key_resolver' => \Your\Name\Space\MyKeyResolver::class,
sh
php artisan vendor:publish --tag=encbuddy-config