32 lines
835 B
PHP
32 lines
835 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Call;
|
|
use App\Models\Event;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\CallHistory>
|
|
*/
|
|
class CallHistoryFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'call_id' => Call::factory(),
|
|
'telephone_id' => $this->faker->numerify('tel-####'),
|
|
'caller_phone_number' => '09' . $this->faker->randomNumber(9, true),
|
|
'event_id' => Event::factory(),
|
|
'event_name' => function (array $attributes) {
|
|
return Event::query()->find($attributes['event_id'])->name;
|
|
}
|
|
];
|
|
}
|
|
}
|