->extraModalFooterActions(fn (ActionTable $action): array => [
$action->makeModalSubmitAction('send')
->label('Send')
->icon('heroicon-o-paper-airplane')
->color('success'),
])
->action(function (array $data, array $arguments, $record, $action): void {
if ($data['message']) {
$customer = Customer::find($record->customer_id);
$message = $data['message'];
$url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
$action->url($url);
$action->openUrlInNewTab();
}
})
->extraModalFooterActions(fn (ActionTable $action): array => [
$action->makeModalSubmitAction('send')
->label('Send')
->icon('heroicon-o-paper-airplane')
->color('success'),
])
->action(function (array $data, array $arguments, $record, $action): void {
if ($data['message']) {
$customer = Customer::find($record->customer_id);
$message = $data['message'];
$url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
$action->url($url);
$action->openUrlInNewTab();
}
})