forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserFactory.php
More file actions
43 lines (33 loc) · 1.17 KB
/
UserFactory.php
File metadata and controls
43 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
use Faker\Generator as Faker;
use Illuminate\Support\Facades\Hash;
use ProcessMaker\Models\User;
$onePassword = Hash::make('oneOnlyPassword');
/**
* Model factory for a User
*/
$factory->define(User::class, function (Faker $faker) use($onePassword) {
return [
'username' => $faker->unique()->userName,
'email' => $faker->unique()->email,
'password' => $onePassword,
'status' => $faker->randomElement(['ACTIVE', 'INACTIVE']),
'firstname' => $faker->firstName,
'lastname' => $faker->lastName,
'address' => $faker->streetAddress,
'city' => $faker->city,
'state' => $faker->stateAbbr,
'postal' => $faker->postcode,
'country' => 'US',
'phone' => $faker->phoneNumber,
'fax' => $faker->phoneNumber,
'cell' => $faker->phoneNumber,
'title' => $faker->jobTitle,
'birthdate' => $faker->dateTimeThisCentury,
'timezone' => $faker->timezone,
'datetime_format' => $faker->randomElement(['Y-m-d H:i', 'm/d/Y', 'm/d/Y h:i A', 'm/d/Y H:i']),
'language' => 'en',
'loggedin_at' => null,
'is_administrator' => false,
];
});