Enhance Group and Document resources; add leader and helper teacher relationships, update navigation icons, and adjust navigation sorting.

This commit is contained in:
2025-08-30 17:21:47 +05:00
parent 18e425f533
commit 710554a28d
24 changed files with 760 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
<?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('teachers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('photo')->nullable();
$table->text('bio')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('teachers');
}
};

View File

@@ -0,0 +1,29 @@
<?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('groups', function (Blueprint $table) {
$table->foreignId('leader_teacher_id')->nullable()->constrained('teachers')->nullOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('groups', function (Blueprint $table) {
$table->dropForeign(['leader_teacher_id']);
$table->dropColumn('leader_teacher_id');
});
}
};

View File

@@ -0,0 +1,29 @@
<?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('group_teacher', function (Blueprint $table) {
$table->id();
$table->foreignId('group_id')->constrained()->cascadeOnDelete();
$table->foreignId('teacher_id')->constrained()->cascadeOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('group_teacher');
}
};