Leaderboard

This is the official documentation of the forestadmin/laravel-forestadmin v2+ and forestadmin/symfony-forestadmin PHP agents.

Leaderboard Charts display a list of records sorted by their value in descending order.

use ForestAdmin\AgentPHP\DatasourceCustomizer\Context\AgentCustomizationContext;
use ForestAdmin\AgentPHP\DatasourceCustomizer\Decorators\Chart\ResultBuilder;

$forestAgent->addChart(
    'companiesLive',
    fn(AgentCustomizationContext $context, ResultBuilder $resultBuilder) => $resultBuilder->leaderboard(
        [
            'Bonanza'   => 5835694,
            'TalkSpace' => 4179218,
            'Tesco'     => 3959931,
            'BitPesa'   => 3856685,
            'Octiv'     => 3747458,
        ]
    )
);

Last updated