543 0 0 0
Some time, you may need to get a record with some relationship and at the same time you need to get an inner relationship to that relationship and so forth. Here is the key : $records->with(['bill', 'bill.sponsor', 'bill.sponsorSenator', 'bill.sponsor.actions']).
$records = new BillEventModel();
$records = $records->newQuery();
$records = $records->with(['bill', 'bill.sponsor', 'bill.sponsorSenator'])->groupBy('bill_id')->orderBy('date', 'desc'); //Use this to add the relatioship and inner ones as well
$recordsCount = $records->get()->count();
$records = $records->paginate(50);