feat: add legal opinions admin management

This commit is contained in:
2026-05-08 18:15:21 +03:30
parent 357859608f
commit ae522c5640
16 changed files with 649 additions and 1 deletions

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::create('legal_opinion_categories', function (Blueprint $table) {
$table->id();
$table->string('name')->unique()->comment('نام دسته‌بندی');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('legal_opinion_categories');
}
};

View File

@@ -0,0 +1,35 @@
<?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('legal_opinions', function (Blueprint $table) {
$table->id();
$table->string('opinion_number')->comment('شماره نظریه');
$table->date('opinion_date')->nullable()->comment('تاریخ نظریه');
$table->string('subject', 1000)->nullable()->comment('موضوع استعلام یا نظریه');
$table->longText('full_text')->comment('متن کامل نظریه و استعلام');
$table->string('issuing_authority')->nullable()->comment('مرجع صدور');
$table->foreignId('category_id')->constrained('legal_opinion_categories')->onDelete('cascade')->comment('شناسه دسته‌بندی');
$table->timestamps();
$table->unique(['opinion_number', 'category_id'], 'unique_opinion_category');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('legal_opinions');
}
};

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('art_legal_opinion', function (Blueprint $table) {
$table->id();
$table->foreignId('art_id')->constrained('art')->onDelete('cascade');
$table->foreignId('legal_opinion_id')->constrained('legal_opinions')->onDelete('cascade');
$table->timestamps();
$table->unique(['art_id', 'legal_opinion_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('art_legal_opinion');
}
};