/
mr.fork
/
learning-git
Обзор
Документация
Войти
/
mr.fork
/
learning-git
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
auth
database/factories/UserFactory.php
44 строки
1 KB
doubleW
create userModel
21 окт 2025, 13:14
21 окт 2025, 13:14
e875c5a
Код
Авторство
О чём код?
<?php namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> */ class UserFactory extends Factory { /** * The current password being used by the factory. */ protected static ?string $password; /** * Define the model's default state. * * @return array<string, mixed> */ public function definition(): array { return [ 'fio' => fake()->name(), 'login' => fake()->unique()->userName(), 'phone' => fake()->phoneNumber(), 'email' => fake()->unique()->safeEmail(), 'password' => 1111, ]; } /** * Indicate that the model's email address should be unverified. */ public function unverified(): static { return $this->state(fn (array $attributes) => [ 'email_verified_at' => null, ]); } }