chore: cleanup project structure and update readme for beta release

This commit is contained in:
2025-12-23 04:59:21 +07:00
parent 1640ced748
commit 10a00bac0e
122 changed files with 8320 additions and 661 deletions

View File

@@ -0,0 +1,45 @@
<?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::dropIfExists('legal_page_revisions');
Schema::dropIfExists('legal_pages');
Schema::create('legal_pages', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug')->unique();
$table->boolean('is_active')->default(true);
$table->timestamps();
});
Schema::create('legal_page_revisions', function (Blueprint $table) {
$table->id();
$table->foreignId('legal_page_id')->constrained()->onDelete('cascade');
$table->longText('content');
$table->string('version')->default('1.0');
$table->text('change_log')->nullable();
$table->boolean('is_active')->default(true);
$table->unsignedBigInteger('created_by')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('legal_page_revisions');
Schema::dropIfExists('legal_pages');
}
};

View File

@@ -0,0 +1,33 @@
<?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('contact_submissions', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->string('name');
$table->string('email');
$table->string('category');
$table->string('subject');
$table->text('message');
$table->boolean('is_read')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('contact_submissions');
}
};

View File

@@ -0,0 +1,47 @@
<?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->uuid('id')->primary();
$table->string('user_id', 32)->index();
$table->string('ticket_number')->unique();
$table->string('subject');
$table->string('category'); // Technical, Billing, etc.
$table->enum('priority', ['low', 'medium', 'high'])->default('medium');
$table->enum('status', ['open', 'answered', 'closed'])->default('open');
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
Schema::create('ticket_replies', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->foreignUuid('ticket_id')->constrained()->onDelete('cascade');
$table->string('user_id', 32)->index();
$table->text('message');
$table->string('attachment_path')->nullable();
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('ticket_replies');
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('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notifications');
}
};

View File

@@ -0,0 +1,28 @@
<?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::table('notifications', function (Blueprint $table) {
$table->string('notifiable_id')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('notifications', function (Blueprint $table) {
$table->unsignedBigInteger('notifiable_id')->change();
});
}
};