<?php
namespace App\Modules\HR\Reports\Data;

use App\Modules\HR\Core\Models\Employee;

class EmployeePhotoReport
{
    public function getData($filters)
    {
        $query = Employee::with(['branch', 'department','designation','gender','maritalStatus','bloodGroup','grade','employmentType','payrollGroup','identificationType']);
                // Branch filter
        if (!empty($filters['branch_id'])) {
            $query->where('branch_id', $filters['branch_id']);
        }

        // Department filter
        if (!empty($filters['department_id'])) {
            $query->where('department_id', $filters['department_id']);
        }

        // Employee filter
        if (!empty($filters['employee_id'])) {
            $query->where('id', $filters['employee_id']);
        }
            $employees =   $query->get();
            return [
            'employees' => $employees
        ];
    }
}
