Struggling with pluck
I have a table action row, which opens a modal. I´m able to access the $record, and when i do a dd on the $record, only the row-record is present. However, if i use the pluck method, it gives me the all the records on that model:
Gives me an unexpected result:
dd($record->pluck('name', 'id'))
Works as expected:
Forms\Components\TextInput::make('test')->default(fn ($record) => dd(($record->name)),
As i understand the documentation, i should be able to use the pluck method and only pluck fields from the selected row record. Is this by design or a bug? Is there other ways to pluck valus form a single row-record?
Gives me an unexpected result:
dd($record->pluck('name', 'id'))
Illuminate\Support\Collection {#2420 ▼ // app/Filament/Resources/CustomerResource.php:261
#items: array:3 [▼
1 => "Demobedriften"
2 => "Datterselskap"
3 => "Test testensen"
]
#escapeWhenCastingToString: false
}Works as expected:
Forms\Components\TextInput::make('test')->default(fn ($record) => dd(($record->name)),
"Demobedriften" // app/Filament/Resources/CustomerResource.php:261As i understand the documentation, i should be able to use the pluck method and only pluck fields from the selected row record. Is this by design or a bug? Is there other ways to pluck valus form a single row-record?