PHP code example of ilbronza / processes

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

    

ilbronza / processes example snippets


use IlBronza\Processes\Helpers\ProcessCreatorHelper;
use IlBronza\Processes\Helpers\ProcessUpdaterHelper;
use IlBronza\Processes\Helpers\ProcessCloserHelper;

$process = ProcessCreatorHelper::create([
    'type' => 'production',
    'operator_id' => $operator->getKey(),
    'planned_starts_at' => '2026-10-16 09:00:00',
    'planned_ends_at' => '2026-10-16 10:00:00',
], ['user' => auth()->user()]);

$process = ProcessUpdaterHelper::update($process, [
    'process_status_id' => $plannedStatus->getKey(),
], ['reason' => 'Pianificazione confermata', 'user' => auth()->user()]);

$process = ProcessCloserHelper::close($process, [
    'status' => $finalStatus,
    'reason' => 'Lavoro terminato',
    'user' => auth()->user(),
    'set_ends_at' => true,
]);