You should be able to use joins instead, something like:
DB::table('companies')
->where('companies.id', user()->companies()->first()->id)
->leftJoin('payments', 'companies.id', '=', 'payments.landlord_id')
->leftJoin('rents', function ($join) {
$join->on('companies.id', '=', 'rents.company_id')->where('status', '!=', 'unpaid')
})->get();
You would need to probably alias columns to line up column names from rents with and payments tables, but otherwise it will work.
Have a look at the Sub joins part of https://laravel.com/docs/5.8/queries#joins to see how you might select the specific columns from the joined tables - you could selectRaw() to alias the columns that need aliasing



