Eager load models

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-08-07 13:39:50 +01:00
parent 14d567e537
commit 0ffe7ec2a1

View file

@ -121,7 +121,7 @@ class AssetsController extends Controller
}
$assets = Asset::select('assets.*')
->with('location', 'assetstatus', 'company', 'defaultLoc','assignedTo',
->with('model', 'location', 'assetstatus', 'company', 'defaultLoc','assignedTo',
'model.category', 'model.manufacturer', 'model.fieldset','supplier'); //it might be tempting to add 'assetlog' here, but don't. It blows up update-heavy users.