- Attendance 모델 (attendances 테이블, 상태/색상 매핑, check_in/check_out accessor) - AttendanceService (목록/월간통계/CRUD, 부서/사원 드롭다운) - API 컨트롤러 (HTMX+JSON 이중 응답, stats/index/store/update/destroy) - 페이지 컨트롤러 (index 페이지 렌더링) - 웹/API 라우트 등록 (hr/attendances, api/admin/hr/attendances) - index.blade.php (통계카드+필터+등록/수정 모달) - partials/table.blade.php (HTMX 부분 로드 테이블)
34 lines
885 B
PHP
34 lines
885 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\HR;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\HR\Attendance;
|
|
use App\Services\HR\AttendanceService;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class AttendanceController extends Controller
|
|
{
|
|
public function __construct(
|
|
private AttendanceService $attendanceService
|
|
) {}
|
|
|
|
/**
|
|
* 근태현황 목록 페이지
|
|
*/
|
|
public function index(): View
|
|
{
|
|
$stats = $this->attendanceService->getMonthlyStats();
|
|
$departments = $this->attendanceService->getDepartments();
|
|
$employees = $this->attendanceService->getActiveEmployees();
|
|
$statusMap = Attendance::STATUS_MAP;
|
|
|
|
return view('hr.attendances.index', [
|
|
'stats' => $stats,
|
|
'departments' => $departments,
|
|
'employees' => $employees,
|
|
'statusMap' => $statusMap,
|
|
]);
|
|
}
|
|
}
|