Wahba
Wahba
FFilament
Created by Wahba on 7/31/2024 in #❓┊help
Search records in an Attach Action
Hello everyone, I was wondering if I could be able to search the records generated by $action->getRecordSelect() in an Attach action. I know there is a way to search by specifying the columns, but I want instead to search using a column in a related record instead. Is there a way to modify the query similar to how we can do it in ->searchable() ?
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
TextInput::make('quantity')->numeric()
->minValue(1)
->required(),
])
->preloadRecordSelect()
->recordSelectOptionsQuery(function ($query) {
return $query
->where('stock', '>', 0);
})
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
TextInput::make('quantity')->numeric()
->minValue(1)
->required(),
])
->preloadRecordSelect()
->recordSelectOptionsQuery(function ($query) {
return $query
->where('stock', '>', 0);
})
4 replies
FFilament
Created by Wahba on 7/31/2024 in #❓┊help
Table Actions in Relation Manager reflect in all table records
Hello Everyone, I'm having some weird issue in my relation managers, where triggering any action in a row, reflects in all others rows. Example: I have a Detach and Edit buttons in each row, and whenever for instance I detach a specific row, all rows get detached, same thing for editing. It's a many to many polymorphic relationship. I'm not sure if I've done anything wrong or is it a bug in Filament? Thanks in advance.
2 replies