56 lines
2.1 KiB
PHP
56 lines
2.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\SupportTicket\Database\Seeders;
|
||
|
|
|
||
|
|
use Illuminate\Database\Seeder;
|
||
|
|
use Illuminate\Support\Facades\DB;
|
||
|
|
use Illuminate\Support\Str;
|
||
|
|
|
||
|
|
class TicketTableSeeder extends Seeder
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Run the database seeds.
|
||
|
|
*/
|
||
|
|
public function run(): void
|
||
|
|
{
|
||
|
|
DB::table('support_tickets')->insert([
|
||
|
|
[
|
||
|
|
'readable_ticket_id' => Str::random(6),
|
||
|
|
'user_id' => 1, // Assuming user_id 1 exists
|
||
|
|
'category_id' => 1, // Assuming category_id 1 exists
|
||
|
|
'restaurant_id' => 1, // Assuming restaurant_id 1 exists
|
||
|
|
'title' => 'Sample Ticket 1',
|
||
|
|
'description' => 'This is a detailed description of the first ticket.',
|
||
|
|
'purchase_code' => 'PUR12345',
|
||
|
|
'status' => 'open',
|
||
|
|
'read' => true,
|
||
|
|
'related_url' => 'https://example.com',
|
||
|
|
'support_plan' => 'Premium',
|
||
|
|
'attachments' => json_encode(['attachment1.png', 'attachment2.pdf']),
|
||
|
|
'last_conversation_time' => now()->subHours(2),
|
||
|
|
'last_respond_by_client_at' => now()->subDay(),
|
||
|
|
'created_at' => now()->subDays(2),
|
||
|
|
'updated_at' => now()->subDay(),
|
||
|
|
],
|
||
|
|
[
|
||
|
|
'readable_ticket_id' => Str::random(6),
|
||
|
|
'user_id' => 2,
|
||
|
|
'category_id' => 2,
|
||
|
|
'restaurant_id' => 1, // No project assigned
|
||
|
|
'title' => 'Sample Ticket 2',
|
||
|
|
'description' => 'This is another detailed description for the second ticket.',
|
||
|
|
'purchase_code' => 'PUR67890',
|
||
|
|
'status' => 'pending',
|
||
|
|
'read' => false,
|
||
|
|
'related_url' => null,
|
||
|
|
'support_plan' => 'Standard',
|
||
|
|
'attachments' => json_encode([]),
|
||
|
|
'last_conversation_time' => null,
|
||
|
|
'last_respond_by_client_at' => null,
|
||
|
|
'created_at' => now()->subDays(5),
|
||
|
|
'updated_at' => now()->subDays(4),
|
||
|
|
],
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|