🔐
Trust Enterprises
  • Getting Started
  • Intro video course
    • Introduction of the Trust Enterprises project [2:16]
    • Deployment of your first Serverless client [6:29]
    • Using Postman with the Trust Enterprises API [6:33]
    • Installation of the Trust Enterprises Laravel package [7:51]
    • Basic interaction with your client with Laravel. [10:28]
  • Deployment
    • Vercel
    • Environment Variables
    • Github Actions
  • REST API
    • Overview
    • Inscriptions
      • Deploy an Inscription
      • Mint an Inscription
      • Burn an Inscription
      • Transfer an Inscription
    • NFT Ecosystem
      • Create an NFT Collection
      • Generate Metadata
      • Mint an NFT
      • Transfer an NFT
      • Claiming NFTs through Passes
    • Accounts
    • Tokens
      • Create a token
      • Bequesting a token
      • Token Holdings and Balance
    • Topics
      • Get topic info
      • Creating a new topic
      • Updating a topic
    • Consensus Messages
    • Balance
    • Status
    • Webhooks
  • The Laravel Client
    • Overview
    • Installation
    • Interacting with your client
    • Create a Marketplace
    • Manage your Inscription Flow
    • Checking account balances and sending tokens
  • Contributing
    • Local Development
      • Architecture Rationale
    • Contributing Guidelines
    • Changelog
  • Links
    • Github
    • Trust Enterprises
    • Postman Documentation
    • Hedera Network Status
    • Remote Software Development
Powered by GitBook
On this page
  • Recording a trust event
  • Imports
  • Code
  • Extending behaviour with event listenters

Was this helpful?

  1. The Laravel Client

Interacting with your client

How to get started with the laravel package.

Recording a trust event

Events can only be recorded using a single private key, this is the default behaviour. This means that you and your users can Trust that the messages will only come from you, the owner of the hedera private key.

If a Topic doesn't exist in your database one will be created before the consensus message is dispatched.

Imports

use Trustenterprises\LaravelHashgraph\LaravelHashgraph;
use Trustenterprises\LaravelHashgraph\Models\ConsensusMessage;

Code

The Consensus Message takes a String if you wish to use an object convert it first using json_encode. We suggest that this code should be run in a Job as it uses the synchronous

$message = new ConsensusMessage('This is an event you wish to store');
$message->setReference('an-internal-model-id'); // optional

LaravelHashgraph::withTopic('Trust Enterprises')->sendMessage($message);

Extending behaviour with event listenters

There are 2 events that can be listened to:

  • ConsensusMessageWasReceived

  • TopicWasCreated

PreviousInstallationNextCreate a Marketplace

Last updated 4 years ago

Was this helpful?

Have a look at the for creating your own listenters for events.

Laravel offical docs for events