© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Eth

retrieving previous record

I’m trying to get the price for the chosen place name but it’s retrieving the previous price -giving null for the first record-

Code:

Forms\Components\Select::make('placeName')
                ->label('Place Name')
                ->required()
                ->live()
                ->searchable()
                ->options(Place::all()->pluck('placeName'))
                ->afterStateUpdated(function ($state, callable $set, callable $get){
                        $place = $get('placeName');
                        $placePrice = Place::find($place)->placePrice;
                        $set('totalPrice', $placePrice);
                    }),
Forms\Components\Select::make('placeName')
                ->label('Place Name')
                ->required()
                ->live()
                ->searchable()
                ->options(Place::all()->pluck('placeName'))
                ->afterStateUpdated(function ($state, callable $set, callable $get){
                        $place = $get('placeName');
                        $placePrice = Place::find($place)->placePrice;
                        $set('totalPrice', $placePrice);
                    }),
IMG_2552.jpg
IMG_2553.jpg
IMG_2554.jpg
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

Get previous/next record in table?
FilamentFFilament / ❓┊help
3y ago
Table, access previous or another record data
FilamentFFilament / ❓┊help
13mo ago
previous and next record inside form using actions
FilamentFFilament / ❓┊help
3y ago
Injected $record the same for each recordActions Action
FilamentFFilament / ❓┊help
4w ago