public function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('question'),
])
->actions([
Action::make('Reply')
->form([
TextInput::make('replyMessage')
->required()
->live()
])
->modalContent(function (ChatSession $record, Action $action) {
return view(
'filament.chat-messages.chats',
['chatSession' => $record],
);
})
->extraModalFooterActions(fn(Action $action): array => [
$action->makeModalSubmitAction('Reply', arguments: ['halt' => true]),
])
->action(function ($action, ChatSession $record, array $data, $arguments, Set $set, Get $get) {
$chatMessageService = new ChatMessageService();
$chatMessageService->create($record->id,$data['replyMessage'],auth()->user()->id,true);
if ($arguments['halt'] === true) {
$action->halt();
}
})
->slideOver()
->modalSubmitAction(false)
]);
}
public function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('question'),
])
->actions([
Action::make('Reply')
->form([
TextInput::make('replyMessage')
->required()
->live()
])
->modalContent(function (ChatSession $record, Action $action) {
return view(
'filament.chat-messages.chats',
['chatSession' => $record],
);
})
->extraModalFooterActions(fn(Action $action): array => [
$action->makeModalSubmitAction('Reply', arguments: ['halt' => true]),
])
->action(function ($action, ChatSession $record, array $data, $arguments, Set $set, Get $get) {
$chatMessageService = new ChatMessageService();
$chatMessageService->create($record->id,$data['replyMessage'],auth()->user()->id,true);
if ($arguments['halt'] === true) {
$action->halt();
}
})
->slideOver()
->modalSubmitAction(false)
]);
}