added support ticket and added more stat widgets

This commit is contained in:
Gitea
2025-05-17 05:11:29 +05:30
parent f30d7fa096
commit 175a7203f3
19 changed files with 975 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tickets', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->string('ticket_id', 6)->unique();
$table->string('subject');
$table->text('message');
$table->enum('status', ['open', 'closed', 'pending'])->default('open');
$table->ipAddress()->nullable();
$table->timestamp('last_response_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tickets');
}
};

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('ticket_responses', function (Blueprint $table) {
$table->id();
$table->foreignId('ticket_id')->constrained()->onDelete('cascade');
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->text('response');
$table->ipAddress()->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('ticket_responses');
}
};