brexis / laravel-workflow

Use the Symfony Workflow component in Laravel
MIT License
281 stars 105 forks source link

The transition guard event isn't fired #10

Closed willemo closed 6 years ago

willemo commented 6 years ago

In Brexis\LaravelWorkflow\Events\WorkflowSubscriber::guardEvent() only the general guard event for the workflow is fired, but not the event for the specific transition (workflow.[workflow name].guard.[transition name]).

To allow someone to create a listener for a specific transition guard, the event has to be thrown. I think it's solved by adding this line to the method:

event('workflow.'.$event->getWorkflowName().'.guard.'.$event->getTransition()->getName(), $event);

If you want, I could create a pull request for this. Thanks!

brexis commented 6 years ago

Fixed in #15