Continue to create after halting #5430
Replies: 4 comments
-
Hi, I would be interested in this topic as well as I have a similar use case. Currently my only idea would be to introduce a hidden form input which could be used to indicate an override of the duplicate check. By triggering another form submit the resource should then be created as it normally would. Is there a more intuitive and elegant approach? |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I'm currently working on a project where this feature would be useful as well. |
Beta Was this translation helpful? Give feedback.
-
Any updates? @danharrin |
Beta Was this translation helpful? Give feedback.
-
I am managing using this approach, but it would be better if there is option to procced or cancel after halt ->before(function (CreateAction $action, array $data) {
$key = "agent_create_" . $data['customer_id'];
if (Cache::has($key)) {
Cache::forget($key);
} else if (Model::where('customer_id', $data['customer_id'])->exists()) {
Notification::make()
->warning()
->title('Customer already exists!')
->body('This customer already exists. Do you want to proceed?')
->duration(2000)
->send();
Cache::remember($key, now()->addMinute(), fn() => true);
$action->requiresConfirmation();
$action->halt();
}
}) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'd like to implement some kind of "Are you sure?" notification/modal when creating something. I'm able to halt the creation, close the notification, but I have no idea how to continue the action (if that is even possible?)
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions