Switched to loadMissing for performance

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-09-23 17:31:19 -07:00
parent 3b7ce0091c
commit 2f9582ee5c

View file

@ -325,7 +325,7 @@ class AssetsController extends Controller
* Include additional associated relationships
*/
if ($request->input('components')) {
$assets->load(['components' => function ($query) {
$assets->loadMissing(['components' => function ($query) {
$query->orderBy('created_at', 'desc');
}]);
}