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