Q: Force Eloquent to retrieve data using inner joins is there any way to make a ->get() using Laravel Eloquent ORM and force it to make the query using inner joins instead of using whereIn?.
I have a relationship of data like this since a have a lot of data in the tables, Eloquent is taking forever to provide the data.
$people= People::with(
        'pets',
        'peopleSize',
        'cars',
        'house',
        'child'
    )->get();

This in creating a query with a whereIn statement with all the ids of the people that I have, and the same for every other relation inside of the with statment.
Is there any way to change that for inner joins using Eloquent ORM? 

A: Yes it is possible you can make join in laravel. You have to read the documentation of laravel. You can use join Like this :- https://laravel.com/docs/5.4/queries#joins
In your case i will provide one exmaple:-
$people= DB::table('peoples')
          ->join('pets', 'peoples.id', '=', 'pets.people_id')
          ->join('people_sizes', 'peoples.id', '=', 'people_sizes.people_id')
          ->get();

Hope it helps! 

A: You Can use laravel Power Join eloquent-power-joins
In your People model
use Kirschbaum\PowerJoins\PowerJoins;

use PowerJoins;
public function pets(): HasMany
{
    return $this->hasMany(Pet::class, 'people_id');
}

In Contorller
public function getData()
{
    $data = Patient::joinRelationshipUsingAlias('pets', 'p')->select('peoples.id', 'p.name')->where('peoples.id', 5)->get();
    return $data;
}


