PHP code example of intermax / blur

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

    

intermax / blur example snippets




declare(strict_types=1);

return [
    'tables' => [
        'users' => [
            'columns' => [
                'name' => 'faker:name',
                'email' => 'faker:email',
                // Add more columns as needed
            ],
            // 'chunk_size' => 2000, // Optional: Set a chunk size; higher is faster but will use more memory
            // 'keys' => ['id'], // Optional: Specify when the automatic discovery won't work
            // 'method' => 'update', // Optional: Use 'clear' to truncate the table instead
        ],
        // Add more tables as needed
    ],
];

'columns' => [
    'name' => 'faker:name',
    'email' => 'faker:email',
    'phone' => 'faker:phoneNumber',
    'address' => 'faker:address',
    // See Faker documentation for more available methods
],



namespace App\Obfuscators;

use Intermax\Blur\Contracts\Obfuscator;

class FixedStringObfuscator implements Obfuscator
{
    public function generate(?array $parameters = null): mixed
    {
        return $parameters[0] ?? 'default-value';
    }
}

'columns' => [
    'some_field' => App\Obfuscators\FixedStringObfuscator::class.':custom-value',
],
bash
php artisan vendor:publish --provider="Intermax\Blur\BlurServiceProvider"
bash
php artisan blur:obfuscate