develop
Last change
on this file since bbcbb57 was 4b7e2d3, checked in by beratkjufliju <kufliju@…>, 3 years ago |
bug fixes, edited export, added fileSeeder for DB testing
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[120759b] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace Database\Factories;
|
---|
| 4 |
|
---|
| 5 | use App\Models\User;
|
---|
| 6 | use Carbon\Carbon;
|
---|
| 7 | use Illuminate\Database\Eloquent\Factories\Factory;
|
---|
| 8 |
|
---|
| 9 | class UserFactory extends Factory
|
---|
| 10 | {
|
---|
| 11 | /**
|
---|
| 12 | * The name of the factory's corresponding model.
|
---|
| 13 | *
|
---|
| 14 | * @var string
|
---|
| 15 | */
|
---|
| 16 | protected $model = User::class;
|
---|
| 17 |
|
---|
| 18 | /**
|
---|
| 19 | * Define the model's default state.
|
---|
| 20 | *
|
---|
| 21 | * @return array
|
---|
| 22 | */
|
---|
| 23 | public function definition()
|
---|
| 24 | {
|
---|
| 25 | return [
|
---|
| 26 | 'name' => $this->faker->firstName(),
|
---|
| 27 | 'surname' => $this->faker->lastName(),
|
---|
[4b7e2d3] | 28 | 'username' => $this->faker->unique()->userName(),
|
---|
[120759b] | 29 | 'password' => $this->faker->password(),
|
---|
[4b7e2d3] | 30 | 'email' => $this->faker->unique()->email(),
|
---|
[d795fa6] | 31 | 'phone_number' => $this->faker->phoneNumber(),
|
---|
[120759b] | 32 | 'role_id' => $this->faker->numberBetween(1, 2),
|
---|
| 33 | 'is_online' => $this->faker->boolean,
|
---|
| 34 | 'is_confirmed' => $this->faker->boolean,
|
---|
| 35 | 'is_forgot_password' => $this->faker->boolean,
|
---|
[d795fa6] | 36 | 'created_by' => "1",
|
---|
[4b7e2d3] | 37 | 'created_at' => now()
|
---|
[120759b] | 38 | ];
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.