equest for leave

This commit is contained in:
2026-07-26 10:49:48 +03:30
parent c54038d986
commit 280d2748f9
9 changed files with 608 additions and 11 deletions
@@ -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
{
public function up(): void
{
Schema::create('leave_requests', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable();
$table->string('user_identity');
$table->string('type'); // daily | hourly
$table->date('date_from');
$table->date('date_to');
$table->time('time_from')->nullable();
$table->time('time_to')->nullable();
$table->text('reason')->nullable();
$table->string('status')->default('pending'); // pending | approved | rejected
$table->unsignedBigInteger('reviewed_by')->nullable();
$table->timestamp('reviewed_at')->nullable();
$table->timestamps();
$table->index(['user_identity', 'status']);
$table->index(['date_from', 'date_to']);
});
}
public function down(): void
{
Schema::dropIfExists('leave_requests');
}
};