dnpage's solution to function count() needin to check whether query is fluent or eloquent

dnpage's solution to function count() needin to check whether query is fluent or eloquent. See issue #8.