Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 868 Bytes

README.md

File metadata and controls

36 lines (29 loc) · 868 Bytes

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