src/Utilities/Helper.php
public static function extractColumnName($str, $wantsAlias)
    {
        $matches = explode(' as ', Str::lower($str));

        if (! empty($matches)) {
            if ($wantsAlias) {
                return array_pop($matches);
            }

            return array_shift($matches);
        } elseif (strpos($str, '.')) {
            $array = explode('.', $str);

            return array_pop($array);
        }

        return $str;
    }
public static function extractColumnName($str, $wantsAlias)
    {
        $matches = explode(' as ', Str::lower($str));

        if (! empty($matches)) {
            if ($wantsAlias) {
                return array_pop($matches);
            }

            return array_shift($matches);
        } elseif (strpos($str, '.')) {
            $array = explode('.', $str);

            return array_pop($array);
        }

        return $str;
    }
public static function extractColumnName ( $ str , $ wantsAlias ) { $ matches = explode ( ' as ' , Str :: lower ( $ str ) ) ; if ( ! empty ( $ matches ) ) { if ( $ wantsAlias ) { return array_pop ( $ matches ) ; } return array_shift ( $ matches ) ; } elseif ( strpos ( $ str , '.' ) ) { $ array = explode ( '.' , $ str ) ; return array_pop ( $ array ) ; } return $ str ; }
Get column name from string.

@param string $str
@param bool   $wantsAlias
@return string
Get column name from string .