PHP code example of soap / laravel-workflow-loader

1. Go to this page and download the library: Download soap/laravel-workflow-loader 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/ */

    

soap / laravel-workflow-loader example snippets


return [
    'loaders' => [
        'database' => [
            'tableNames' => [
                'workflows' => 'workflows',
                'workflow_states' => 'workflow_states',
                'workflow_transitions' => 'workflow_transitions',
                'workflow_state_transitions' => 'workflow_state_transitions',
            ],
            'class' => \Soap\WorkflowLoader\DatabaseLoader::class,
        ],
    ],
];


namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class WorkflowServiceProvider extends ServiceProvider
{
    public function register() {}

    public function boot()
    {
        $registry = app()->make('workflow');
        $workflowLoaderRegistry = app()->make('workflowLoaderRegistry');   
        foreach ($workflowLoaderRegistry->all() as $workflow => $config) {
            $registry->addFromArray($workflow, $config);
        }
    }
}
bash
php artisan vendor:publish --tag="workflow-loader-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="workflow-loader-config"

php artisan venodr:publish --tag="workflow-loader-provider"