Skip to content

Commit ea14440

Browse files
committed
Merge branch 'master' of github.com:brexis/laravel-workflow
2 parents 1c5e200 + 1396110 commit ea14440

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ $post->workflow_can('to_review'); // False
113113
foreach ($post->workflow_transitions() as $transition) {
114114
echo $transition->getName();
115115
}
116+
// if more than one workflow is defined for the BlogPost class
117+
foreach ($post->workflow_transitions($workflowName) as $transition) {
118+
echo $transition->getName();
119+
}
116120

117121
// Apply a transition
118122
$post->workflow_apply('publish');

src/Traits/WorkflowTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function workflow_can($transition, $workflow = null)
1919
return Workflow::get($this, $workflow)->can($this, $transition);
2020
}
2121

22-
public function workflow_transitions()
22+
public function workflow_transitions($workflow = null)
2323
{
24-
return Workflow::get($this)->getEnabledTransitions($this);
24+
return Workflow::get($this, $workflow)->getEnabledTransitions($this);
2525
}
2626
}

0 commit comments

Comments
 (0)