Looking to hire Laravel developers? Try LaraJobs

laravel-db-faker-mask maintained by svilborg

Description
Laravel DB Masking
Last update
2021/08/02 05:16 (dev-dependabot/composer/phpunit/phpunit-9.5.8)
License
Links
Downloads
27

Comments
comments powered by Disqus

Laravel DB Faker Masking

Configuration

Available in config/db_mask.php

Sample configuration file

    return [
        /*
         * |--------------------------------------------------------------------------
         * | DB Mask rules
         * |--------------------------------------------------------------------------
         * |
         */
        'chunk' => 1000,
        'tables' => [
            'users' => [
                'firstname' => 'firstName',
                'lastname' => 'lastName',
                'email' => function (Faker $faker) {
                    return $faker->email;
                },
                'number' => function (Faker $faker, array $record) {
                    return $record['id'] . $faker->numberBetween(0, 100000);
                }
            ]
        ]
    ];

Usage

artisan db:mask