Created
January 23, 2019 06:44
-
-
Save prondubuisi/93bc3ae54b02c2139bd7f0e36783dc33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Faker\Generator as Faker; | |
/* | |
|-------------------------------------------------------------------------- | |
| Model Factories | |
|-------------------------------------------------------------------------- | |
| | |
| This directory should contain each of the model factory definitions for | |
| your application. Factories provide a convenient way to generate new | |
| model instances for testing / seeding your application's database. | |
| | |
*/ | |
$factory->define(App\User::class, function (Faker $faker) { | |
return [ | |
'name' => $faker->name, | |
'email' => $faker->unique()->safeEmail, | |
'email_verified_at' => now(), | |
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret | |
'remember_token' => str_random(10), | |
]; | |
}); | |
$factory->define(App\Product::class, function (Faker $faker) { | |
return [ | |
'title' => $faker->text(10), | |
'description' => $faker->word, | |
'price' => $faker->numberBetween(200,500) | |
]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment