1. Go to this page and download the library: Download norotaro/enumata-recorder 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/ */
norotaro / enumata-recorder example snippets
use Norotaro\Enumata\Traits\HasStateMachines;
use Norotaro\EnumataRecorder\Traits\LogTransitions;
class Order extends Model
{
use HasStateMachines, LogTransitions;
protected $casts = [
'status' => OrderStatus::class,
];
}
$order->stateLogs;
// or
$order->stateLogs()->get();
use Norotaro\Enumata\Traits\HasStateMachines;
use Norotaro\EnumataRecorder\Traits\LogTransitions;
class Order extends Model
{
use HasStateMachines, LogTransitions;
protected $casts = [
'status' => OrderStatus::class,
'fulfillment' => OrderFulfillment::class,
];
}