1
|
<?php
|
2
|
|
3
|
/** @var Factory $factory */
|
4
|
|
5
|
use App\User;
|
6
|
use Faker\Generator as Faker;
|
7
|
use Illuminate\Database\Eloquent\Factory;
|
8
|
use Illuminate\Support\Str;
|
9
|
|
10
|
/*
|
11
|
|--------------------------------------------------------------------------
|
12
|
| Model Factories
|
13
|
|--------------------------------------------------------------------------
|
14
|
|
|
15
|
| This directory should contain each of the model factory definitions for
|
16
|
| your application. Factories provide a convenient way to generate new
|
17
|
| model instances for testing / seeding your application's database.
|
18
|
|
|
19
|
*/
|
20
|
|
21
|
$factory->define(User::class, function (Faker $faker) {
|
22
|
return [
|
23
|
'name' => $faker->name,
|
24
|
'email' => $faker->unique()->safeEmail,
|
25
|
'email_verified_at' => now(),
|
26
|
'password' => bcrypt($faker->unique()->password),
|
27
|
'remember_token' => Str::random(10),
|
28
|
'created_at' => now(),
|
29
|
'updated_at' => now(),
|
30
|
];
|
31
|
});
|