adding whereRelated and orderByRandom methods