public static function avg($field, $filters = null)
    {
        return (float)static::query()->where($filters)->avg($field);
    }
public static function avg($field, $filters = null)
    {
        return (float)static::query()->where($filters)->avg($field);
    }
public static function avg ( $ field , $ filters = null ) { return ( float ) static :: query ( ) -> where ( $ filters ) -> avg ( $ field ) ; }
Allows to calculate the average value on a column matching the specified conditions

@param string $field =array_keys(static::sample())[$i]
@param array  $filters =static::sample()

@return float|null
Allows to calculate the average value on a column matching the specified conditions