hypothetical/database/factories/UserFactory.php

28 lines
875 B
PHP
Raw Normal View History

<?php
2019-09-06 01:32:11 -04:00
/** @var \Illuminate\Database\Eloquent\Factory $factory */
2019-03-19 17:40:13 -04:00
use App\User;
use Faker\Generator as Faker;
2019-10-31 17:24:53 -04:00
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| 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.
|
*/
2019-03-19 17:40:13 -04:00
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
2016-09-22 13:40:58 -04:00
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
2019-03-19 17:40:13 -04:00
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});