PHP code example of nubitio / workflow-bundle

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

    

nubitio / workflow-bundle example snippets


use Nubit\WorkflowBundle\Attribute\Workflow;

#[Workflow(
    field: 'status',
    transitions: [
        'send_to_kitchen' => [
            'from' => ['open'],
            'to' => 'preparing',
            'label' => 'Enviar a cocina',
            'roles' => ['ROLE_WAITER'],
        ],
        'pay' => [
            'from' => ['served', 'open'],
            'to' => 'paid',
            'label' => 'Cobrar',
            'set' => ['paymentMethod' => 'cash'],
        ],
    ],
)]
class Order { ... }