From dda8007986813fc27b9839b084368cb253cd15bb Mon Sep 17 00:00:00 2001 From: Orlyapps Date: Thu, 24 Mar 2022 13:04:52 +0100 Subject: [PATCH] ignore NotEnabledTransitionException --- src/Actions/WorkflowAction.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Actions/WorkflowAction.php b/src/Actions/WorkflowAction.php index 62df9e4..cc6b04f 100644 --- a/src/Actions/WorkflowAction.php +++ b/src/Actions/WorkflowAction.php @@ -45,9 +45,14 @@ public function uriKey() public function handle(ActionFields $fields, Collection $models) { foreach ($models as $model) { - $workflow = \Workflow::get($model, \Str::lower(class_basename($model))); - $workflow->apply($model, request()->transition); - $model->save(); + try { + $workflow = \Workflow::get($model, \Str::lower(class_basename($model))); + $workflow->apply($model, request()->transition); + $model->save(); + } catch (\Throwable $th) { + //throw $th; + } + } }