- 달력/목록 뷰 전환, 단일/기간/대량 등록 지원 - 공휴일/회사지정/대체휴일/임시휴일 유형 관리 - 시스템 관리 메뉴에 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
805 B
PHP
42 lines
805 B
PHP
<?php
|
|
|
|
namespace App\Models\System;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Holiday extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'holidays';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'start_date',
|
|
'end_date',
|
|
'name',
|
|
'type',
|
|
'is_recurring',
|
|
'memo',
|
|
'created_by',
|
|
'updated_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'start_date' => 'date',
|
|
'end_date' => 'date',
|
|
'is_recurring' => 'boolean',
|
|
];
|
|
|
|
public function scopeForTenant($query, int $tenantId)
|
|
{
|
|
return $query->where('tenant_id', $tenantId);
|
|
}
|
|
|
|
public function scopeForYear($query, int $year)
|
|
{
|
|
return $query->whereYear('start_date', $year);
|
|
}
|
|
}
|