API Charts
Code cheatsheet
Legacy agent
New agent
How to migrate
<?php
namespace App\Http\Controllers;
use ForestAdmin\LaravelForestAdmin\Facades\ChartApi;
use Stripe\StripeClient;
class ChartsController extends Controller
{
public function mrr()
{
$mrr = 0;
$stripe = new StripeClient('sk_AABBCCDD11223344');
$charges = $stripe->charges->all(['limit' => 3]);
foreach ($charges as $charge) {
$mrr += $charge->amount;
}
return ChartApi::renderValue($mrr);
}
}Last updated