PHP code example of wuwx / laravel-workflow

1. Go to this page and download the library: Download wuwx/laravel-workflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wuwx / laravel-workflow example snippets



return [
    'workflows' => [
        'process_1' => [
            'places' => ['initial', 'place_1', 'place_2'],
            'transitions' => [
                'transition_1' => [
                    'froms' => ['initial'], 'tos' => ['place_1'],
                ],
                'transition_2' => [
                    'froms' => ['place_1'], 'tos' => ['place_2'],
                ],
            ],
        ],
     ],
];

Gate::define('viewWorkflow', function ($user) {
    return true;
});