Files
hr/app/Filament/Resources/Vacations/Schemas/VacationForm.php
2026-07-31 18:08:08 +05:00

38 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Resources\Vacations\Schemas;
use App\Enums\VacationType;
use App\Filament\Support\HrForm;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Schema;
class VacationForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
HrForm::employeeSelect(),
Select::make('type')
->options(VacationType::class)
->required()
->native(false),
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
DatePicker::make('return_date')
->label(__('hr.fields.return_date')),
HrForm::leaveDaysDisplay(),
Textarea::make('reason')
->rows(3)
->columnSpanFull(),
HrForm::fileUpload('attachment_path')
->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240),
]);
}
}