<?php

namespace App\Traits;

trait StatHelpers
{
    public static function getLastValue()
    {
        $item = self::query()->start(now())->end(now()->subSecond())->groupByDay()->get();

        return $item ? $item[0]->value : 0;
    }
}
