/home/techb158/ileadtechnology.com/SSM/app/Models/employee
NameSizeModeActions
Attendance.php32100644editdlrm
AttendanceDetail.php20930644editdlrm
Employee.php85730644editdlrm
EmployeeAccount.php19260644editdlrm
EmployeeDesignation.php18750644editdlrm
EmployeeDocument.php19990644editdlrm
EmployeeQualification.php17240644editdlrm
EmployeeTerm.php15350644editdlrm
LeaveAllocation.php24080644editdlrm
LeaveAllocationDetail.php16280644editdlrm
LeaveRequest.php35270644editdlrm
LeaveRequestDetail.php18310644editdlrm
Payroll.php33810644editdlrm
PayrollDetail.php12650644editdlrm
PayrollTemplate.php21430644editdlrm
PayrollTemplateDetail.php15800644editdlrm
Salary.php31560644editdlrm
SalaryDetail.php17880644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/app/Models/employee/Payroll.php (3381B)
'array', 'start_date' => 'date', 'end_date' => 'date']; protected $primaryKey = 'id'; protected $table = 'payrolls'; protected static $logName = 'payroll'; protected static $logFillable = true; protected static $logOnlyDirty = true; protected static $ignoreChangedAttributes = ['updated_at']; protected $appends = ['balance','number']; public function payrollDetails() { return $this->hasMany('App\Models\Employee\PayrollDetail','payroll_id'); } public function employee() { return $this->belongsTo('App\Models\Employee\Employee'); } public function salary() { return $this->belongsTo('App\Models\Employee\Salary', 'employee_salary_id'); } public function transactions() { return $this->hasMany('App\Models\Finance\Transaction\Transaction'); } public function getOption(string $option) { return array_get($this->options, $option); } public function getBalanceAttribute() { return $this->total - $this->paid; } public function getNumberAttribute() { return $this->prefix.str_pad($this->id, 3, '0', STR_PAD_LEFT); } public function scopeInfo($q) { return $q->with([ 'employee:id,code,prefix,first_name,middle_name,last_name,contact_number', 'employee.employeeDesignations:id,employee_id,designation_id,department_id,date_effective,date_end', 'employee.employeeDesignations.designation:id,name,employee_category_id', 'employee.employeeDesignations.designation.employeeCategory:id,name', 'employee.employeeDesignations.department:id,name', 'payrollDetails:id,payroll_id,pay_head_id,amount', 'payrollDetails.payHead:id,name,alias,type', 'transactions' => function($q1) { $q1->select('id','payroll_id','prefix','number','account_id','payment_method_id','amount','date','instrument_number','instrument_bank_detail','reference_number','instrument_date','instrument_clearing_date')->where('is_cancelled','=',0); }, 'transactions.account:id,name', 'transactions.paymentMethod:id,name,options' ]); } public function scopeFilterById($q, $id) { if (! $id) { return $q; } return $q->where('id', '=', $id); } public function scopeFilterByEmployeeId($q, $employee_id) { if (! $employee_id) { return $q; } return $q->where('employee_id', '=', $employee_id); } }