1. Go to this page and download the library: Download elvesora/allocora-laravel 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/ */
elvesora / allocora-laravel example snippets
use Elvesora\Allocora\Laravel\Contracts\ClientInterface;
final class SynchronizePayees
{
public function __construct(private readonly ClientInterface $allocora) {}
public function __invoke(): array
{
return (array) $this->allocora->payees()->list()->data();
}
}
use Elvesora\Allocora\Laravel\Client;
$allocora = app(Client::class);
$response = $allocora->products()->show($productId);
use Elvesora\Allocora\Laravel\Facades\Allocora;
$payees = Allocora::payees()->list()->data();
// Payees
$allocora->payees()->list($query);
$allocora->payees()->show($id);
$allocora->payees()->create($record);
$allocora->payees()->batchCreate($records);
$allocora->payees()->upsert($record);
$allocora->payees()->batchUpsert($records);
$allocora->payees()->update($id, $changes);
$allocora->payees()->batchUpdate($recordsWithIds);
// Products: the same method set, plus archival
$allocora->products()->archive($id);
$allocora->products()->batchArchive($recordsWithIds);
// Immutable revenue records
$allocora->revenues()->list($query);
$allocora->revenues()->show($id);
$allocora->revenues()->create($record);
$allocora->revenues()->batchCreate($records);
// Rules: the payee method set, plus status and version history
$allocora->rules()->toggleStatus($id);
$allocora->rules()->versions($id);