Thanks but it will give result after modifiying to this if you are using namespaces in models
MyModel::query()->join('path\to\your\Model', 'r.id=path\to\your\second\Model','r','INNER')->execute();
**My Model represents the model (table) from which you want to get data from.