© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
core

Access model $record issue in Select (pluck)

I am trying the following:
I want to select only the related recipe stages according to the recipe_id, this is inside a RecipeResource, inside an IngredientsRelationsManager.
'''
->form(fn (AttachAction $action): array => [
Forms\Components\Select::make('recipe_stage_id')
->placeholder('Select Stage')
->columnSpan(1)
->required()
->options((fn (Recipe $record) => RecipeStage::where('recipe_id', $record->id)->pluck('name', 'id')->toArray())),
......
'''
error:
Argument #1 ($record) must be of type App\Models\Recipe, null given,
Solution
Change options like this inside relation manager
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

issue with pluck() on array
FilamentFFilament / ❓┊help
3y ago
How to access $record in RelationManager inside Repeater Select
FilamentFFilament / ❓┊help
3y ago
Access $record in resource
FilamentFFilament / ❓┊help
2y ago
filter record in relations model
FilamentFFilament / ❓┊help
2y ago