<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Employee extends Model
{
    protected $table = 'employees';
    public $timestamps = false;

    protected $fillable = [

        'store_id',
        'first_name',
        'last_name',
        'phone',
        'image',
        'email',
        'joining_date',
        'salary',
        'status',
        'latitude',
        'longitude'
    ];
    public function role()
    {
        return $this->belongsTo(Role::class, 'role_id');
    }
    // Relationship with Payroll
    public function payroll()
    {
        return $this->hasMany(EmployeePayroll::class, 'employee_id');
    }

    // Relationship with Attendance
    public function attendance()
    {
        return $this->hasMany(AttendanceLog::class, 'employee_id');
    }
}
