Souhail Bouaouiss
MutateRecordDataUsing
I am trying to fill two inputs in a form before starting to edit but the mutateRecordDataUsing seems to not committing any changes. I have tried to just see if I access the hook using dd('here') but it seems like I never access it . This is my code
Tables\Actions\EditAction::make()->mutateRecordDataUsing(function (array $data): array {
$prix = DB::table('com_srv_prices')
->where('srv_id', $data['id'])
->value('mnt_ttc');
$tva = DB::table('com_srv_prices')
->where('srv_id', $data['id'])
->value('tva');
$data['tva'] = $tva;
$data['prix'] = $prix;
return $data;
})
])
2 replies