Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/svilborg/laravel-db-faker-mask

Database Masking with Faker for Laravel
https://github.com/svilborg/laravel-db-faker-mask

cli command-line db faker laravel laravel-command mask php

Last synced: about 1 month ago
JSON representation

Database Masking with Faker for Laravel

Awesome Lists containing this project

README

        

# Laravel DB Faker Masking

### Configuration

Available in config/db_mask.php

Sample configuration file

```php
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