PHP code example of laravel-chronicle / core

1. Go to this page and download the library: Download laravel-chronicle/core 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/ */

    

laravel-chronicle / core example snippets


use Chronicle\Facades\Chronicle;

Chronicle::record()
    ->actor($user)
    ->action('order.created')
    ->subject($order)
    ->metadata([
        'total' => 1000,
        'currency' => 'USD',
    ])
    ->commit();

use Chronicle\Entry\Entry;

Entry::forActor($user);
Entry::forSubject($order);
Entry::action('order.created');
Entry::withTag('orders');

use Chronicle\Entry\Entry;

Entry::stream()->each(function ($entry) {
    // process entry
});

use Chronicle\Entry\Entry;

Entry::cursorPaginateLedger(50);
bash
php artisan chronicle:export
bash
php artisan chronicle:verify-export