<?php

namespace App\Models\Modules;

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

class Shift extends Model
{
  //* Associated Table & Primary Key
    protected $table = 'shifts';
    protected $primaryKey = 'id';

  //* Fillable Fields
    protected $fillable = [
        'name',
        'work_starts_at',
        'work_ends_at',
    ];

  //* Relationships
    public function users() {
        return $this->hasMany(\App\Models\User::class);
    }

    public function audits() {
        return $this->hasMany(\App\Models\Modules\Audits\Audit::class);
    }
}
