lpoems
How to change the content of TextColumn
Tables\Columns\TextColumn::make('status')
->badge()->color(fn (bool $state): bool => match ($state) {
true => 'success',
false => 'danger',
})
The TextColumn will display 0 or 1 (true or false). How to make it display 'True' or 'False' ?
5 replies
Why mutateFormDataBeforeCreate() doesn't work
protected function mutateFormDataBeforeCreate(array $data): array
{
$private = RSA::createKey(2048);
$data['private_key'] = (string)$private;
$data['public_key'] = (string)$private->getPublicKey();
//ddd($data);
return $data;
}
After I click the button 'create', I found that the field 'private_key' 'public_key' in the newest record is still null. However, the ddd($data) works when I uncommented it.
4 replies