Files
HRM-System/app/Models/ThirteenthMonthRun.php

53 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ThirteenthMonthRun extends BaseModel
{
use HasFactory;
protected $fillable = [
'title',
'year',
'start_year',
'end_year',
'start_month',
'end_month',
'branch_id',
'total_base_earnings',
'total_payout',
'employee_count',
'status',
'notes',
'created_by',
];
protected $casts = [
'year' => 'integer',
'start_year' => 'integer',
'end_year' => 'integer',
'start_month' => 'integer',
'end_month' => 'integer',
'total_base_earnings' => 'decimal:2',
'total_payout' => 'decimal:2',
'employee_count' => 'integer',
];
public function branch()
{
return $this->belongsTo(Branch::class);
}
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
public function entries()
{
return $this->hasMany(ThirteenthMonthEntry::class);
}
}