feat: add feedback api

This commit is contained in:
2026-06-07 15:38:35 +03:30
parent 11a1565323
commit 49dc7824c3
4 changed files with 150 additions and 0 deletions
@@ -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
{
/**
* App-level feedback (نظرات و ایده‌ها): one editable entry per user holding an
* overall star rating and/or an idea/comment about the application.
*/
public function up(): void
{
Schema::create('app_feedback', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->unsignedTinyInteger('stars')->nullable(); // 1-5 overall rating
$table->text('content')->nullable(); // idea / comment
$table->timestamps();
$table->unique('user_id'); // one feedback row per user (edited in place)
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('app_feedback');
}
};