Implemented eager loading for the people show view.

This commit is contained in:
Lukas Halbritter
2018-10-01 09:58:04 +02:00
parent 8f865e9bff
commit e9077193af
4 changed files with 164 additions and 167 deletions
+4 -5
View File
@@ -20,12 +20,11 @@ class PeopleController extends Controller
public function show(Person $person)
{
$memberStates = $person->memberStates;
$targets = $person->targets;
$actuals = $person->actuals;
$person->load('targets.actuals.accountType.accountClass.ioType',
'targets.actuals.booking',
'targets.ioType');
return view('people.show', compact('person', 'memberStates', 'targets',
'actuals'));
return view('people.show', compact('person'));
}
// Show the form for creating a new person