Files
HRM-System/app/Models/Resignation.php
2026-04-13 08:16:56 +08:00

60 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Resignation extends BaseModel
{
use HasFactory;
protected $fillable = [
'employee_id',
'resignation_date',
'last_working_day',
'notice_period',
'reason',
'description',
'status',
'documents',
'approved_by',
'approved_at',
'exit_feedback',
'exit_interview_conducted',
'exit_interview_date',
'created_by'
];
protected $casts = [
'resignation_date' => 'date:Y-m-d',
'last_working_day' => 'date:Y-m-d',
'approved_at' => 'datetime',
'exit_interview_conducted' => 'boolean',
'exit_interview_date' => 'date:Y-m-d',
];
/**
* Get the employee who submitted this resignation.
*/
public function employee()
{
return $this->belongsTo(User::class, 'employee_id');
}
/**
* Get the user who approved this resignation.
*/
public function approver()
{
return $this->belongsTo(User::class, 'approved_by');
}
/**
* Get the user who created this resignation.
*/
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
}