F
Filament5mo ago
Steff

Action works fast but modal window hangs?

Tables\Actions\Action::make('Run')
->action(function ($record) {
$service = new MyService();
$result = $service->myServiceClass($record->id);
// dd($result); up to here is fast, the action is ready
// then the modal window hangs also without Notification
Notification::make()
...
})
->requiresConfirmation(),
Tables\Actions\Action::make('Run')
->action(function ($record) {
$service = new MyService();
$result = $service->myServiceClass($record->id);
// dd($result); up to here is fast, the action is ready
// then the modal window hangs also without Notification
Notification::make()
...
})
->requiresConfirmation(),
does anyone have any ideas as to why this could be?
Solution:
I think i found it:
'debug' => FALSE,
'debug' => FALSE,
Jump to solution
5 Replies
Steff
SteffOP4mo ago
I have tried various solutions (cancel modal, redirect, refresh etc.) but nothing works. the modal just hangs and the job was actually finished quickly. is it better to do an asynchronous or background job?
toeknee
toeknee4mo ago
Can you provide the whole code?
ChesterS
ChesterS4mo ago
So if you remove everything after $result = $service->myServiceClass($record->id); the modal remains open?
Steff
SteffOP4mo ago
Yes, if i remove everything after, the modal remains open (also without modal, the action link hangs). it hangs after this response within the myServiceClass:
$response = $client->request('GET', $requestBase . $receive_slug, [
'query' => $receive_params,
'allow_redirects' => TRUE,
'timeout' => 10,
'verify' => FALSE,
'connect_timeout' => 5,
'debug' => TRUE,
'headers' => [
'User-Agent: curl / 7.81.0'
]
]);
$response = $client->request('GET', $requestBase . $receive_slug, [
'query' => $receive_params,
'allow_redirects' => TRUE,
'timeout' => 10,
'verify' => FALSE,
'connect_timeout' => 5,
'debug' => TRUE,
'headers' => [
'User-Agent: curl / 7.81.0'
]
]);
But the service is ready.
Solution
Steff
Steff4mo ago
I think i found it:
'debug' => FALSE,
'debug' => FALSE,

Did you find this page helpful?