brexis / laravel-workflow

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

How to choose the second tos #76

Closed wangle201210 closed 4 years ago

wangle201210 commented 4 years ago

config/workflow.php

<?php

return [
    'straight'   => [
        'type'          => 'workflow',
        'marking_store' => [
            'type'      => 'multiple_state',
            'arguments' => ['currentPlace']
        ],
        'supports'      => ['App\BlogPost'],
        'places'        => ['draft', 'review', 'rejected', 'published'],
        'transitions'   => [
            'to_review' => [
                'from' => 'draft',
                'to'   => 'review'
            ],
            'approval' => [
                'from' => 'review',
                'to'   => ['published','rejected']
            ]
        ],
    ]
];

when approval how can i choose 'rejected' without add third transition

$workflow->apply($post, 'approval');

my code just can choose 'published'

wangle201210 commented 4 years ago

The flow chart is as follows,i want to choose rejected or published with one transition straight