© 2026 Hedgehog Software, LLC

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

issue with pluck() on array

I’m trying to display a list of options according to the place name from database (option from options -json- as you could see in the image)
But it’s showing me the error message “Call to a member function pluck() on array”

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;
                        $placeOptions = Place::find($place)?->options->pluck('option');
                        $set('totalPrice', $placePrice);
                        $set('options', $placeOptions);
                    })
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;
                        $placeOptions = Place::find($place)?->options->pluck('option');
                        $set('totalPrice', $placePrice);
                        $set('options', $placeOptions);
                    })
IMG_2526.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

Struggling with pluck
FilamentFFilament / ❓┊help
3y ago
Access model $record issue in Select (pluck)
FilamentFFilament / ❓┊help
3y ago
SpatieTagsColumn pluck() on null after update
FilamentFFilament / ❓┊help
3y ago