37 lines
743 B
PHP
37 lines
743 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\HRM\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class LeaveApplication extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'restaurant_id',
|
||
|
|
'employee_id',
|
||
|
|
'leave_type_id',
|
||
|
|
'start_date',
|
||
|
|
'end_date',
|
||
|
|
'reason',
|
||
|
|
'admin_note',
|
||
|
|
'status',
|
||
|
|
'approved_by',
|
||
|
|
'leave_duration_type',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const TABLE_NAME = 'leave_applications';
|
||
|
|
|
||
|
|
protected $table = self::TABLE_NAME;
|
||
|
|
|
||
|
|
public function employee(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Employee::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function leaveType(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(LeaveType::class);
|
||
|
|
}
|
||
|
|
}
|