Files
Website/database/factories/UserFactory.php

53 lines
1.5 KiB
PHP

<?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
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'firstname' => fake()->firstName(),
'surname' => fake()->lastName(),
'phone' => fake()->phoneNumber(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'remember_token' => Str::random(10),
'shipping_address' => fake()->streetAddress(),
'shipping_city' => fake()->city(),
'shipping_state' => '',
'shipping_postcode' => fake()->postcode(),
'shipping_country' => fake()->country(),
'billing_address' => fake()->streetAddress(),
'billing_city' => fake()->city(),
'billing_state' => '',
'billing_postcode' => fake()->postcode(),
'billing_country' => fake()->country(),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}