source: database/factories/UserFactory.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 965 bytes
Line 
1<?php
2
3namespace Database\Factories;
4
5use Illuminate\Database\Eloquent\Factories\Factory;
6use Illuminate\Support\Str;
7
8class UserFactory extends Factory
9{
10 /**
11 * Define the model's default state.
12 *
13 * @return array
14 */
15 public function definition()
16 {
17 return [
18 'name' => $this->faker->name(),
19 'email' => $this->faker->unique()->safeEmail(),
20 'email_verified_at' => now(),
21 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
22 'remember_token' => Str::random(10),
23 ];
24 }
25
26 /**
27 * Indicate that the model's email address should be unverified.
28 *
29 * @return \Illuminate\Database\Eloquent\Factories\Factory
30 */
31 public function unverified()
32 {
33 return $this->state(function (array $attributes) {
34 return [
35 'email_verified_at' => null,
36 ];
37 });
38 }
39}
Note: See TracBrowser for help on using the repository browser.