From df05556ea4f55642c015a8efaf5e9205090f0677 Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Wed, 28 Feb 2024 16:36:21 -0500 Subject: [PATCH] Make workflowName optional --- src/AbstractWorkflow.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AbstractWorkflow.php b/src/AbstractWorkflow.php index 1bc2c56..15999c3 100644 --- a/src/AbstractWorkflow.php +++ b/src/AbstractWorkflow.php @@ -15,6 +15,7 @@ use Closure; use Illuminate\Container\Container; +use Illuminate\Support\Str; use Sassnowski\Venture\Manager\WorkflowManagerInterface; use Sassnowski\Venture\Models\Workflow; use Sassnowski\Venture\Testing\WorkflowTester; @@ -87,8 +88,8 @@ public function run(?string $connection = null): Workflow return $manager->startWorkflow($this, $connection); } - protected function define(string $workflowName = ''): WorkflowDefinition + protected function define(?string $workflowName = null): WorkflowDefinition { - return new WorkflowDefinition($this, $workflowName); + return new WorkflowDefinition($this, $workflowName ?? Str::headline(class_basename(static::class))); } }