<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Employees extends Model
{
    protected $fillable = ['employee_id','prefix','first_name','last_name','middle_name','email_address','gender','role','business_unit','department','job_title','employment_status','date_of_joining','date_of_leaving','years_of_experience','work_phone','personal_phone','extension','kra_pin','nssf_number','nhif_number','ifmis_number','reporting_manager','duration','password','isAdmin','created_by','modified_by','is_active'];

    public static function getEmployees(){

        $records = DB::table('employees')->select('employee_id','prefix','first_name','last_name','middle_name','email_address','gender','role','business_unit','department','job_title','employment_status','date_of_joining','date_of_leaving','years_of_experience','work_phone','personal_phone','extension','kra_pin','nssf_number','nhif_number','ifmis_number','reporting_manager','duration','isAdmin','created_by','modified_by','is_active')->orderBy('id', 'desc')->get()->toArray();
   
        return $records;
    }
}
