PHP code example of svilborg / laravel-db-faker-mask
1. Go to this page and download the library: Download svilborg/laravel-db-faker-mask 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/ */
svilborg / laravel-db-faker-mask example snippets
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);
}
]
]
];