Closed iqmal852 closed 4 years ago
Picture will be self explain
PHP
fzaninotto/faker
$faker = Faker\Factory::create(); $entries = []; $data = [ "name" => $faker->name, "email" => $faker->unique()->safeEmail, "email_verified_at" => now(), "password" => bcrypt("password"), "remember_token" => $faker->name, "created_at" => now(), "updated_at" => now(), ]; for ($x = 0; $x <= 100; $x++) { $entries[] = $data; } $entries;
The output should be different each time looping
[ [ "name" => "Prof. Deion Huels DVM", "email" => "prohaska.brendan@example.com", "email_verified_at" => Illuminate\Support\Carbon @1590590664 {#1010}, "password" => "$2y$10$dqhBGM5mB/CD7E9dJw.ct.cn4uozeOQtjAk./fddHQ9KBOCT1GCZq", "remember_token" => "Jevon Krajcik", "created_at" => Illuminate\Support\Carbon @1590590664 {#1007}, "updated_at" => Illuminate\Support\Carbon @1590590664 {#1006}, ], [ "name" => "Prof. Deion Huels DVM", "email" => "prohaska.brendan@example.com", "email_verified_at" => Illuminate\Support\Carbon @1590590664 {#1010}, "password" => "$2y$10$dqhBGM5mB/CD7E9dJw.ct.cn4uozeOQtjAk./fddHQ9KBOCT1GCZq", "remember_token" => "Jevon Krajcik", "created_at" => Illuminate\Support\Carbon @1590590664 {#1007}, "updated_at" => Illuminate\Support\Carbon @1590590664 {#1006}, ], [ "name" => "Prof. Deion Huels DVM", "email" => "prohaska.brendan@example.com", "email_verified_at" => Illuminate\Support\Carbon @1590590664 {#1010}, "password" => "$2y$10$dqhBGM5mB/CD7E9dJw.ct.cn4uozeOQtjAk./fddHQ9KBOCT1GCZq", "remember_token" => "Jevon Krajcik", "created_at" => Illuminate\Support\Carbon @1590590664 {#1007}, "updated_at" => Illuminate\Support\Carbon @1590590664 {#1006}, ], ]
Image Attachment
Solved!
Summary
Picture will be self explain
Versions
PHP
fzaninotto/faker
Self-enclosed code snippet for reproduction
Expected output
Actual output
Image Attachment