I want to mutate record data using $this->record

how to
mutateRecordDataUsing
mutateRecordDataUsing
but using $this->record array? Thank you
protected function getHeaderActions(): array
{
return [
EditAction::make()
->label('Check In')
->record($this->record)
->form([
Toggle::make('isCheckedIn'),
])
//below doesn't work if using $this->record
->mutateRecordDataUsing(function (array $this->record): array {
$data['chekedInTime'] = Carbon::now();

return $data;
})
];
}
protected function getHeaderActions(): array
{
return [
EditAction::make()
->label('Check In')
->record($this->record)
->form([
Toggle::make('isCheckedIn'),
])
//below doesn't work if using $this->record
->mutateRecordDataUsing(function (array $this->record): array {
$data['chekedInTime'] = Carbon::now();

return $data;
})
];
}
2 Replies
Dennis Koch
Dennis Koch2mo ago
but using $this->record array?
Why?
//below doesn't work if using $this->record
Yeah, that's a syntax error
Want results from more Discord servers?
Add your server
More Posts