- 휴가관리가이드.md 마크다운 콘텐츠 작성 (연차 산출 방식, 촉진 제도 등) - 잔여연차 탭 헤더에 도움말(?) 버튼 추가 - help-modal.blade.php 생성 (sales 패턴 재사용) - LeaveController에 helpGuide() 메서드 추가 - 도움말 라우트 등록
54 lines
1.5 KiB
PHP
54 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\HR;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\HR\Leave;
|
|
use App\Services\HR\LeaveService;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Http\Response;
|
|
use Illuminate\Support\Str;
|
|
|
|
class LeaveController extends Controller
|
|
{
|
|
public function __construct(
|
|
private LeaveService $leaveService
|
|
) {}
|
|
|
|
public function index(\Illuminate\Http\Request $request): View|Response
|
|
{
|
|
if ($request->header('HX-Request')) {
|
|
return response('', 200)->header('HX-Redirect', route('hr.leaves.index'));
|
|
}
|
|
|
|
$employees = $this->leaveService->getActiveEmployees();
|
|
$departments = $this->leaveService->getDepartments();
|
|
$typeMap = Leave::TYPE_MAP;
|
|
$statusMap = Leave::STATUS_MAP;
|
|
|
|
return view('hr.leaves.index', [
|
|
'employees' => $employees,
|
|
'departments' => $departments,
|
|
'typeMap' => $typeMap,
|
|
'statusMap' => $statusMap,
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* 휴가관리 가이드 도움말 모달
|
|
*/
|
|
public function helpGuide(): View
|
|
{
|
|
$guidePath = resource_path('markdown/휴가관리가이드.md');
|
|
|
|
if (file_exists($guidePath)) {
|
|
$markdown = file_get_contents($guidePath);
|
|
$htmlContent = Str::markdown($markdown);
|
|
} else {
|
|
$htmlContent = '<p class="text-gray-500">가이드를 찾을 수 없습니다.</p>';
|
|
}
|
|
|
|
return view('hr.leaves.partials.help-modal', compact('htmlContent'));
|
|
}
|
|
}
|