clarion-app/eloquent-multichain-bridge

在区块链上复制模型

dev-main 2024-08-06 07:42 UTC

This package is auto-updated.

Last update: 2024-09-06 07:47:03 UTC


README

将 Eloquent ORM 连接到 MultiChain

  • 安装
composer require clarion-app/eloquent-multichain-bridge
  • 确保您的迁移包括:主键的 UUID、时间戳和 softDeletes
        Schema::create('messages', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->timestamps();
            $table->softDeletes();
            $table->string("from");
            $table->string("to");
            $table->string("body");
        });
  • 将特性添加到您的模型中
use ClarionApp\EloquentMultiChainBridge\EloquentMultiChainBridge;

class Message extends Model
{
    use HasFactory, EloquentMultiChainBridge;
}

现在,当创建、更新或删除消息时,将在区块链上复制一份。