32 lines
804 B
PHP
32 lines
804 B
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;
|
||
|
|
|
||
|
|
class LeaveController extends Controller
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
private LeaveService $leaveService
|
||
|
|
) {}
|
||
|
|
|
||
|
|
public function index(): View|Response
|
||
|
|
{
|
||
|
|
$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,
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|