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
Sjoerd245w ago
Something like ->formatStateUsing(fn() => ‘’) ?
Dennis Koch
Dennis Koch5w ago
Just use a Placeholder?
TheNastyPasty
TheNastyPasty5w 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 Koch5w ago
Ah, right, they are form components. So just an empty TextEntry? 🤔 Or a ViewEntry
TheNastyPasty
TheNastyPasty5w 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 Koch5w ago
::make('') should never be an empty string. It's a unique identifier
TheNastyPasty
TheNastyPasty5w 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 Koch5w ago
What about this?
TextEntry::make('gross_rent')
->label('Vacancy')
->formatStateUsing(fn() => ''),
TextEntry::make('gross_rent')
->label('Vacancy')
->formatStateUsing(fn() => ''),
TheNastyPasty
TheNastyPasty5w 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
another opt ->state('Gross Rent')
TheNastyPasty
TheNastyPasty5w ago
No description
No description
TheNastyPasty
TheNastyPasty5w ago
You mean like so
TextEntry::make('gross_rent')
->hiddenLabel(true)
->state('Gross Rent'),
TextEntry::make('gross_rent')
->hiddenLabel(true)
->state('Gross Rent'),