© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
thyk123

Reset/load fields after select field updated

Hello, i want to make field qty reset or loaded after select field updated.

 Forms\Components\Select::make('inventory_id')
                    ->label('Inventory Name')
                    ->distinct()
                    ->required()
                    ->live()
                    ->options(Inventory::all()->pluck('asset_name', 'id'))
                    ->searchable()
                    ->afterStateUpdated(function (Livewire $livewire) {
                        $livewire->reset('qty');
                    }),

\LaraZeus\Quantity\Components\Quantity::make('qty')
                        ->minValue(1)
                        ->maxValue(function($record){
                            if(!empty($record))
                            $record->inventory->qty-$record->inventory->inventory_location_list->count();
                            else return '1';
                            })
                        ->required(),
 Forms\Components\Select::make('inventory_id')
                    ->label('Inventory Name')
                    ->distinct()
                    ->required()
                    ->live()
                    ->options(Inventory::all()->pluck('asset_name', 'id'))
                    ->searchable()
                    ->afterStateUpdated(function (Livewire $livewire) {
                        $livewire->reset('qty');
                    }),

\LaraZeus\Quantity\Components\Quantity::make('qty')
                        ->minValue(1)
                        ->maxValue(function($record){
                            if(!empty($record))
                            $record->inventory->qty-$record->inventory->inventory_location_list->count();
                            else return '1';
                            })
                        ->required(),


I want to get data maxValue qty have relationship from $record that must be selected before
How to achive that?
Thank you!
Solution
Example is a little different than what you're trying to achieve, but the logic is same
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Select Field collapsing after
FilamentFFilament / ❓┊help
2y ago
Pass 'Select' field values to other fields.
FilamentFFilament / ❓┊help
3y ago
updatedActiveTab bug reset
FilamentFFilament / ❓┊help
3y ago
Make CheckBoxList selected when SELECT field is updated.
FilamentFFilament / ❓┊help
2y ago