Replicate action do not exclude passed attributes.

I need to replicate records from model 'LegacyClient' to model 'Client'. In the 'clients' table I do not need some attributes from 'legacy_clients'. Implementing '->excludeAttributes' does not work.
->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),

ReplicateAction::make()
->excludeAttributes(['legacy_contacts_count', 'sector', 'data_record_creator', 'data_record_manager'])
->action(function (LegacyClient $record) {
$data = $record->replicate();
$data->setTable('clients');
$data->save();
}),

])
])
->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),

ReplicateAction::make()
->excludeAttributes(['legacy_contacts_count', 'sector', 'data_record_creator', 'data_record_manager'])
->action(function (LegacyClient $record) {
$data = $record->replicate();
$data->setTable('clients');
$data->save();
}),

])
])
I get: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sector' in 'field list'. Any advice...? thanks.
1 Reply
Pablo Torres
Pablo TorresOP8mo ago
I have also tried passing an array of the attributes needed to be replicated... no luck.
ReplicateAction::make()
->action(function (LegacyClient $record) {
$data = $record->replicate([
'name',
'aka',
'address_line_one',
'address_line_two',
'address_line_three',
]);
$data->setTable('clients');
$data->save();
}),
ReplicateAction::make()
->action(function (LegacyClient $record) {
$data = $record->replicate([
'name',
'aka',
'address_line_one',
'address_line_two',
'address_line_three',
]);
$data->setTable('clients');
$data->save();
}),
Want results from more Discord servers?
Add your server