1. Go to this page and download the library: Download acacha/stateful-eloquent 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 Acacha\Stateful\Traits\StatefulTrait;
use Acacha\Stateful\Contracts\Stateful;
class Transaction extends Model implements Stateful
{
use StatefulTrait;
}
class CreateModelTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('model', function (Blueprint $table) {
$table->increments('id');
...
$table->string('state');
...
$table->timestamps();
});
}
$transaction = new Transaction();
//Execute transition
$transaction->process();
//Check if a state is active (return true or false)
$transaction->active();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.