
PK 
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Payroll extends Model
{
protected $fillable = [
'employee_id',
'month',
'year',
'gross_salary',
'total_deductions',
'net_salary',
'status',
'pf_employee',
'esi_employee',
'loan_deduction',
'professional_tax',
'tds'
];
/* =========================
| ACCESSORS (FIX VIEW BUG)
|=========================*/
public function getGrossAttribute()
{
return $this->gross_salary;
}
public function getDeductionsAttribute()
{
return $this->total_deductions;
}
public function getNetAttribute()
{
return $this->net_salary;
}
public function employee()
{
return $this->belongsTo(Employee::class);
}
}


PK 99