PHP code example of mohamedhekal / flowforge

1. Go to this page and download the library: Download mohamedhekal/flowforge 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/ */

    

mohamedhekal / flowforge example snippets


use Hekal\FlowForge\Facades\FlowForge;

FlowForge::publish('Order notify', [
    'steps' => [
        [
            'key' => 'log',
            'type' => 'action',
            'action' => 'log',
            'params' => ['message' => 'order received'],
        ],
        [
            'key' => 'wait',
            'type' => 'delay',
            'seconds' => 60,
        ],
        [
            'key' => 'hook',
            'type' => 'action',
            'action' => 'webhook',
            'params' => ['url' => 'https://example.test/hooks/order'],
        ],
    ],
], slug: 'order-notify');

$run = FlowForge::start('order-notify', ['order_id' => 42]);
// Continues via ContinueWorkflowRunJob (sync in tests; queue in production)

FlowForge::extend('reserve-stock', ReserveStockAction::class);
bash
composer vendor:publish --tag=flowforge-config
php artisan migrate