Passed
Push — main ( 8a25dd...3c103b )
by TARIQ
12:48
created

UserFactory::definition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
nc 1
nop 0
dl 0
loc 8
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use Illuminate\Support\Str;
7
8
/**
9
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
10
 */
11
class UserFactory extends Factory
12
{
13
    /**
14
     * Define the model's default state.
15
     *
16
     * @return array<string, mixed>
17
     */
18
    public function definition()
19
    {
20
        return [
21
            'name' => $this->faker->name(),
22
            'email' => $this->faker->unique()->safeEmail(),
23
            'email_verified_at' => now(),
0 ignored issues
show
Bug introduced by
The function now was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
            'email_verified_at' => /** @scrutinizer ignore-call */ now(),
Loading history...
24
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25
            'remember_token' => Str::random(10),
26
        ];
27
    }
28
29
    /**
30
     * Indicate that the model's email address should be unverified.
31
     *
32
     * @return static
33
     */
34
    public function unverified()
35
    {
36
        return $this->state(function (array $attributes) {
37
            return [
38
                'email_verified_at' => null,
39
            ];
40
        });
41
    }
42
}
43