© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Sleepless

Repeater set a Variable per Field

Hello There

I'm creating a Form with a Repeater Element.
For each Field in that Repeater I need to calculate if it's readonly or not. For this I use the Function 'Model::checkIfModelFieldHasData($models_id, $get('name'))'

Based on the result of this call, i need to make all Inputs in the Repeater Field readonly.
How can I achieve this without calling this function separately for each Input in my Repeater.

Code:
$schema[] = Repeater::make('data')
            ->label(__('miniapp.fields'))
            ->schema([
                TextInput::make('name')
                    ->label(__('miniapp.name'))
                    ->required()
                    ->readonly(fn ($get) => Model::checkIfModelFieldHasData($models_id, $get('name')))
                    ->hint(fn ($get) => (Model::checkIfModelFieldHasData($models_id, $get('name')) ?  __('miniapp.fieldnoteditable') : '' ) )
                    ->hintColor('warning'),
$schema[] = Repeater::make('data')
            ->label(__('miniapp.fields'))
            ->schema([
                TextInput::make('name')
                    ->label(__('miniapp.name'))
                    ->required()
                    ->readonly(fn ($get) => Model::checkIfModelFieldHasData($models_id, $get('name')))
                    ->hint(fn ($get) => (Model::checkIfModelFieldHasData($models_id, $get('name')) ?  __('miniapp.fieldnoteditable') : '' ) )
                    ->hintColor('warning'),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Set css class per repeater item
FilamentFFilament / ❓┊help
13mo ago
Field Repeater, $get and $set
FilamentFFilament / ❓┊help
3y ago
Set temporary upload disk per-FileUpload field
FilamentFFilament / ❓┊help
5mo ago
Update each repeater field 2 fields outside the repeater
FilamentFFilament / ❓┊help
2y ago