<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class EmployeePayrollManager extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    /**An Employee Payroll belongs to a specific Employee**/
    public function employee()
    {
        return $this->belongsTo(User::class, 'u_id');
    }

    /**A Payroll Entry was done by a specific User**/
    public function user(){
        return $this->belongsTo(User::class, 'created_by');
    }

    /**An Employee Payroll is approved by a Specific User**/
    public function approver(){
        return $this->belongsTo(User::class, 'approved_by');
    }
}
