2024-10-15 19:30:20 +03:00
|
|
|
<?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
|
|
|
|
{
|
|
|
|
protected static ?string $password;
|
|
|
|
|
|
|
|
public function definition(): array
|
|
|
|
{
|
|
|
|
return [
|
2024-10-16 22:02:42 +03:00
|
|
|
'name' => fake()->unique()->name(),
|
2024-10-15 19:30:20 +03:00
|
|
|
'password' => static::$password ??= Hash::make('password'),
|
|
|
|
'remember_token' => Str::random(10),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|