Skip to content

Commit 1b7fdc5

Browse files
Merge pull request #44 from UC-LeuvenLimburg/task/optimize-queries
task/optimize-queries
2 parents 64a2ac0 + 6443376 commit 1b7fdc5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Repositories/LeaseRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class LeaseRepository implements ILeaseRepository
1414
*/
1515
public function getLeases()
1616
{
17-
return Lease::orderBy('id', 'asc')->paginate(15);
17+
return Lease::with('rentable')->orderBy('id', 'asc')->paginate(15);
1818
}
1919

2020
/**

app/Repositories/RentableRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RentableRepository implements IRentableRepository
1414
*/
1515
public function getRentables()
1616
{
17-
return Rentable::orderBy('id', 'asc')->paginate(15);
17+
return Rentable::with('user')->orderBy('id', 'asc')->paginate(15);
1818
}
1919

2020
/**

0 commit comments

Comments
 (0)