<?php

namespace App\Models\Employee;

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

class SchShift extends Model
{
    use HasFactory;

    public $fillable = [
        'name',
        'shift_start',
        'shift_end',
        'status',
        'legends',
        'color_code',
        'created_by',
        'updated_by',
    ];

    public function employee(){
        return $this->belongsTo('App\Models\Employee\SchEmployee', 'sch_employee_id');
    }

    public static function getShiftPeriod($id){
        return self::select('shift_start', 'shift_end')->find($id);
    }
}
