alpha
alpha
FFilament
Created by alpha on 1/31/2024 in #❓┊help
TableAction in the first row of a table
Eventually, I came across a workaround. As a reminder, I needed to hide a TableAction in all rows except the first one. Since directly injecting $rowLoop into the hidden method of the TableAction wasn't possible, I approached it differently: I injected the Table and model record into the hidden method. Inside the closure, I accessed the LiveWire instance from the table. With that, I checked if the current row ID is equal to $livewire->cachedTableRecords[0]->id. This allowed me to display the action only for the first row and hide it for the rest: ->hidden(function (Table $table, Record $record) { // A workaround since FilamentPHP does not inject $rowLoop into TableAction $livewire = $table->getLivewire(); if ($record->id == $livewire->cachedTableRecords[0]->id) { return false; } return true; }) There may be a more elegant solution, but this approach resolved the issue for me. Hopefully, it can assist others facing similar challenges.
3 replies
FFilament
Created by cpereiraweb on 8/17/2023 in #❓┊help
Accessor as a column in the Attach action on a RelationManager
Hi @Leandro Ferreira , any idea of doing this but keeping the select search functionality? This solution works but the select has all the options preloaded and don't do the search as the select that the AttachAction has.
8 replies