You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/database/factories/ContactFactory.php

29 lines
731 B
PHP

<?php
namespace Database\Factories;
use App\Models\Contact;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class ContactFactory extends Factory
{
protected $model = Contact::class;
public function definition(): array
{
$first_name = $this->faker->firstName();
$last_name = $this->faker->lastName();
$email = strtolower($first_name . '.' . $last_name) . '@example.com';
return [
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $email,
'phone' => $this->faker->phoneNumber(),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
}