Skip to content

Commit

Permalink
Merge branch 'master' of github.com:brexis/laravel-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brexis committed Sep 25, 2019
2 parents 1c5e200 + 1396110 commit ea14440
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ $post->workflow_can('to_review'); // False
foreach ($post->workflow_transitions() as $transition) {
echo $transition->getName();
}
// if more than one workflow is defined for the BlogPost class
foreach ($post->workflow_transitions($workflowName) as $transition) {
echo $transition->getName();
}

// Apply a transition
$post->workflow_apply('publish');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/WorkflowTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function workflow_can($transition, $workflow = null)
return Workflow::get($this, $workflow)->can($this, $transition);
}

public function workflow_transitions()
public function workflow_transitions($workflow = null)
{
return Workflow::get($this)->getEnabledTransitions($this);
return Workflow::get($this, $workflow)->getEnabledTransitions($this);
}
}

0 comments on commit ea14440

Please sign in to comment.