How to get record in `columns` fn

i need to generate the columns dinamically.
public static function table(Table $table): Table
{
return $table
->query(Response::latest())
->columns((function (): array {
// here i need to retrieve the record to be able to costumize the columns
$record = ??
...
public static function table(Table $table): Table
{
return $table
->query(Response::latest())
->columns((function (): array {
// here i need to retrieve the record to be able to costumize the columns
$record = ??
...
is this possible?
2 Replies
toeknee
toeknee13mo ago
Depends where the dynamic bit is coming from..... But usually no, you would tend to include all, have have the column visibility set on a colusre condition depending on your selection.
ericmp #2
ericmp #2OP13mo ago
hmm okay thanks for ur time

Did you find this page helpful?