public static function averageAmount($since = 0, $until = null)
    {
        $until = $until ?: time();

        return (int) self::where('created', '>=', $since)
            ->where('created', '<=', $until)
            ->avg('total');
    }
public static function averageAmount($since = 0, $until = null)
    {
        $until = $until ?: time();

        return (int) self::where('created', '>=', $since)
            ->where('created', '<=', $until)
            ->avg('total');
    }
public static function averageAmount ( $ since = 0 , $ until = null ) { $ until = $ until ? : time ( ) ; return ( int ) self :: where ( 'created' , '>=' , $ since ) -> where ( 'created' , '<=' , $ until ) -> avg ( 'total' ) ; }
Return the average amount of purchases.

@param integer $since UNIX timestamp to optionally specify a lower selection boundary.
@param integer $until UNIX timestamp to optionally specify an upper selection boundary.
@return integer
Return the average amount of purchases .