Only show label in a infolist

I want to show only a label in a repeatableentry without a value in a infolist. Is this somehow possible? Everything I tried didn't work. I need to align the labels with the values in the other repeatableentries.
Section::make()
->visible(true)
->schema([

RepeatableEntry::make('')
->label('Income')
->schema([
//Labels here
])
->contained(false)
->columnSpan(1),

RepeatableEntry::make('calculationProjectionsFirstYear')
->label('Year 1')
->schema([

TextEntry::make('gross_rent')
->hiddenLabel(true)
->money('AED', 100),

TextEntry::make('vacancy')
->hiddenLabel(true)
->money('AED', 100),

TextEntry::make('operating_income_total')
->hiddenLabel(true)
->money('AED', 100),
])
->contained(false)
->columnSpan(1),
Section::make()
->visible(true)
->schema([

RepeatableEntry::make('')
->label('Income')
->schema([
//Labels here
])
->contained(false)
->columnSpan(1),

RepeatableEntry::make('calculationProjectionsFirstYear')
->label('Year 1')
->schema([

TextEntry::make('gross_rent')
->hiddenLabel(true)
->money('AED', 100),

TextEntry::make('vacancy')
->hiddenLabel(true)
->money('AED', 100),

TextEntry::make('operating_income_total')
->hiddenLabel(true)
->money('AED', 100),
])
->contained(false)
->columnSpan(1),
12 Replies
Sjoerd24
Sjoerd24β€’2mo ago
Something like ->formatStateUsing(fn() => β€˜β€™) ?
Dennis Koch
Dennis Kochβ€’2mo ago
Just use a Placeholder?
TheNastyPasty
TheNastyPastyβ€’2mo ago
Does not work in a infolist. Gives me
Filament\Infolists\ComponentContainer::Filament\Infolists\Concerns\{closure}(): Argument #1 ($component) must be of type Filament\Infolists\Components\Component, Filament\Forms\Components\Placeholder given
Filament\Infolists\ComponentContainer::Filament\Infolists\Concerns\{closure}(): Argument #1 ($component) must be of type Filament\Infolists\Components\Component, Filament\Forms\Components\Placeholder given
Dennis Koch
Dennis Kochβ€’2mo ago
Ah, right, they are form components. So just an empty TextEntry? πŸ€” Or a ViewEntry
TheNastyPasty
TheNastyPastyβ€’2mo ago
Textentry gives me the relation
TextEntry::make('')->label('Gross Rent'),
TextEntry::make('')->label('Gross Rent'),
I am only doing it with a repeatableentry to get the same layout and to align the labels with the values in the next repeatable entry
Dennis Koch
Dennis Kochβ€’2mo ago
::make('') should never be an empty string. It's a unique identifier
TheNastyPasty
TheNastyPastyβ€’2mo ago
TextEntry::make('gross_rent')
->hiddenLabel(true)
->formatStateUsing(fn() => 'Vacancy'),
TextEntry::make('gross_rent')
->hiddenLabel(true)
->formatStateUsing(fn() => 'Vacancy'),
This works but is most probably not optimal?
Dennis Koch
Dennis Kochβ€’2mo ago
What about this?
TextEntry::make('gross_rent')
->label('Vacancy')
->formatStateUsing(fn() => ''),
TextEntry::make('gross_rent')
->label('Vacancy')
->formatStateUsing(fn() => ''),
TheNastyPasty
TheNastyPastyβ€’2mo ago
This aligns better
TextEntry::make('gross_rent')
->hiddenLabel(true)
->formatStateUsing(fn() => 'Gross Rent'),
TextEntry::make('gross_rent')
->hiddenLabel(true)
->formatStateUsing(fn() => 'Gross Rent'),
LeandroFerreira
LeandroFerreiraβ€’2mo ago
another opt ->state('Gross Rent')
TheNastyPasty
TheNastyPastyβ€’2mo ago
No description
No description
TheNastyPasty
TheNastyPastyβ€’2mo ago
You mean like so
TextEntry::make('gross_rent')
->hiddenLabel(true)
->state('Gross Rent'),
TextEntry::make('gross_rent')
->hiddenLabel(true)
->state('Gross Rent'),