protected function getHeaderActions(): array
{
return [
// Recycle Legacy Client Data Action btn.
Action::make('recycle')
->label('New Client (Recyle)')
->action(function (array $data): void {
//Data from the form in EditLegacyClient.php
$name = $data['name'];
$telephone = $data['telephone'];
//Variables to be sent to the form in CreateClient.php page
$data['name'] = $name;
$data['telephone'] = $telephone;
})
->color('warning')
->icon('heroicon-s-arrow-path')
->requiresConfirmation()
->modalHeading('Create new client using Legacy Client data?')
->modalDescription('Confirm your intention to reuse this legacy client data to create a new client record.')
->modalSubmitActionLabel('New Client (Recyle)')
->visible(
fn () => in_array(Auth()->user()->role, ['SUPERADMIN', 'ADMIN', 'MANAGER', 'ASSOCIATE'])
),
];
}
protected function getHeaderActions(): array
{
return [
// Recycle Legacy Client Data Action btn.
Action::make('recycle')
->label('New Client (Recyle)')
->action(function (array $data): void {
//Data from the form in EditLegacyClient.php
$name = $data['name'];
$telephone = $data['telephone'];
//Variables to be sent to the form in CreateClient.php page
$data['name'] = $name;
$data['telephone'] = $telephone;
})
->color('warning')
->icon('heroicon-s-arrow-path')
->requiresConfirmation()
->modalHeading('Create new client using Legacy Client data?')
->modalDescription('Confirm your intention to reuse this legacy client data to create a new client record.')
->modalSubmitActionLabel('New Client (Recyle)')
->visible(
fn () => in_array(Auth()->user()->role, ['SUPERADMIN', 'ADMIN', 'MANAGER', 'ASSOCIATE'])
),
];
}