1. Go to this page and download the library: Download bantenprov/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/ */
use Bantenprov\Workflow\Traits\WorkflowStateTrait;
class WorkflowStateController extends Controller
{
use WorkflowStateTrait;
public function index()
{
return WorkflowStateTrait::stateIndex();
}
}
use Bantenprov\Workflow\Traits\WorkflowTransitionTrait;
class WorkflowTransitionController extends Controller
{
use WorkflowTransitionTrait;
public function index()
{
return WorkflowStateTrait::transitionIndex();
}
}
//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
$id = 1;
return \Workflow::getStateName($id);
}
//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
$id = 1;
return \Workflow::getTransitionName($id);
}