Can I access field not dehydrated in after method?

Hi guys, I have RelationManager with toggle in form that is not dehydrated. Based on this toggle I want to do some stuff after relation is created. I can probably update whole saving relationship process on CreateAction, but I hoped for simpler solution.
Tables\Actions\CreateAction::make()
->after(function (OrderMaterial $record, array $data): void {
if ($data['log_consumption']) {
$record->consumptions()->create([
'amount' => $data['norm'],
'date' => today(),
]);
}
}),
Tables\Actions\CreateAction::make()
->after(function (OrderMaterial $record, array $data): void {
if ($data['log_consumption']) {
$record->consumptions()->create([
'amount' => $data['norm'],
'date' => today(),
]);
}
}),
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?