<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class Employee
 * 
 * @property int $employee_ID
 * @property string $name
 * @property string|null $NIC_No
 * @property string $position
 * @property string|null $mobile_No
 * @property string|null $home_No
 * @property Carbon|null $birth_Day
 * @property string $address
 * @property Carbon $joined_Date
 * @property string|null $image
 * @property string $status
 * 
 * @property Collection|EmployeeAttendance[] $employee_attendances
 * @property UserAccount $user_account
 *
 * @package App\Models
 */
class Employee extends Model
{
	protected $table = 'employee';
	protected $primaryKey = 'employee_ID';
	public $timestamps = false;

	protected $casts = [
		'birth_Day' => 'datetime',
		'joined_Date' => 'datetime'
	];

	protected $fillable = [
		'name',
		'NIC_No',
		'position',
		'mobile_No',
		'home_No',
		'birth_Day',
		'address',
		'joined_Date',
		'image',
		'status'
	];

	public function employee_attendances()
	{
		return $this->hasMany(EmployeeAttendance::class);
	}

	public function user_account()
	{
		return $this->hasOne(UserAccount::class, 'employee_ID');
	}
}
