Highlights

Overview #

Highlights is an section on top of main element like admin table or detail information to show additional information. Here you can put any widgets into it.

Usages #

Resource #

Highlights is added to resource by overriding the highlights() method of Resource:

class Customer extends Resource
{
    protected function highlights()
    {
        return [
            CustomerPaymentValue::create(),
            CustomerOrderTrend::create(),
            ...
        ];
    }
}

Glass #

Highlights is added to glass by overriding the highlights() method of Glass:

class MostValueCustomerGlass extends Glass
{
    protected function highlights()
    {
        return [
            CustomerPaymentValue::create(),
            CustomerOrderTrend::create(),
            ...
        ];
    }
}

DetailScreen #

Adding highlights to detail screen is slightly different which you do:

class Customer extends Resource
{
    protected function onCreated()
    {
        $this->detailScreen()->highlights(function($id){
            // You receive $id is the id value of record
            // You return a list of widgets here

            return [
                ThisCustomerOrderTrend::create(),
                ThisCustomerOrderValue::create(),
                ...
            ];
        });
    }
}

Get started with KoolReport

KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.