CasperSecurity
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('leave_requests', function (Blueprint $table) {
$table->id();
$table->string('employee_id')->nullable();
$table->foreignId('leave_type')->constrained('leave_types')->nullable();
$table->string('from_date')->nullable();
$table->string('to_date')->nullable();
$table->integer('days_for_leave')->nullable();
$table->text('reason')->nullable();
$table->text('req_id')->nullable();
$table->foreignId('manager_id')->nullable();
$table->tinyInteger('manager_approval_status')->default('1');
$table->foreignId('hr_id')->nullable();
$table->tinyInteger('hr_approval_status')->default('1');
$table->tinyInteger('status')->default('1');
$table->string('created_by')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('leave_requests');
}
};