2021-08-31 12:28:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
use App\Models\Contact;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
|
2023-02-18 09:34:57 +00:00
|
|
|
/**
|
|
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Contact>
|
|
|
|
*/
|
2021-08-31 12:28:00 +01:00
|
|
|
class ContactFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $model = Contact::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
2023-02-18 09:34:57 +00:00
|
|
|
* @return array<string, mixed>
|
2021-08-31 12:28:00 +01:00
|
|
|
*/
|
2023-02-18 09:34:57 +00:00
|
|
|
public function definition(): array
|
2021-08-31 12:28:00 +01:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'nick' => mb_strtolower($this->faker->firstName),
|
|
|
|
'name' => $this->faker->name(),
|
|
|
|
'homepage' => $this->faker->url,
|
|
|
|
'twitter' => mb_strtolower($this->faker->firstName),
|
|
|
|
'facebook' => $this->faker->randomNumber(5),
|
|
|
|
'created_at' => Carbon::now()->toDateTimeString(),
|
|
|
|
'updated_at' => Carbon::now()->toDateTimeString(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|