equest for leave
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user