components([ HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')), HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')), HrForm::leaveDaysDisplay(), TextInput::make('medical_institution') ->label(__('hr.fields.institution')) ->maxLength(255), Textarea::make('reason') ->label(__('hr.fields.reason')) ->rows(3) ->columnSpanFull(), HrForm::fileUpload('document_path') ->label(__('hr.fields.medical_document')) ->acceptedFileTypes(['application/pdf', 'image/*']) ->maxSize(10240), ]); } public function table(Table $table): Table { return $table ->recordTitleAttribute('start_date') ->columns([ TextColumn::make('start_date') ->label(__('hr.fields.start_date')) ->date() ->sortable(), TextColumn::make('end_date') ->label(__('hr.fields.end_date')) ->date() ->sortable(), TextColumn::make('days') ->label(__('hr.fields.days')) ->numeric() ->sortable(), TextColumn::make('medical_institution') ->label(__('hr.fields.institution')) ->searchable() ->toggleable(), IconColumn::make('document_path') ->label(__('hr.fields.document')) ->boolean() ->trueIcon('heroicon-o-document-check') ->falseIcon('heroicon-o-document'), ]) ->filters([ TrashedFilter::make(), ]) ->headerActions([ CreateAction::make(), ]) ->recordActions([ EditAction::make(), DeleteAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ForceDeleteBulkAction::make(), RestoreBulkAction::make(), ]), ]); } }