34 lines
839 B
PHP
34 lines
839 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Ticket;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Ticket>
|
|
*/
|
|
class TicketFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'ticket_id' => 'TICKET-'.fake()->unique()->numberBetween(1000, 9999),
|
|
'subject' => fake()->sentence(),
|
|
'message' => fake()->paragraph(),
|
|
'status' => fake()->randomElement(['open', 'closed', 'pending']),
|
|
'ip_address' => fake()->ipv4(),
|
|
'last_response_at' => now(),
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
];
|
|
}
|
|
}
|