UserFactory::unverified()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Database\Factories;
4
5
use App\Models\User;
6
use Illuminate\Database\Eloquent\Factories\Factory;
7
use Illuminate\Support\Str;
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->name(),
27
            'email' => $this->faker->unique()->safeEmail(),
28
            'email_verified_at' => now(),
29
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
30
            'remember_token' => Str::random(10),
31
        ];
32
    }
33
34
    /**
35
     * Indicate that the model's email address should be unverified.
36
     *
37
     * @return \Illuminate\Database\Eloquent\Factories\Factory
38
     */
39
    public function unverified()
40
    {
41
        return $this->state(function (array $attributes) {
0 ignored issues
show
Unused Code introduced by
The parameter $attributes is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
            return [
43
                'email_verified_at' => null,
44
            ];
45
        });
46
    }
47
}
48