From f9a20bc91726f3babfe1fcd41b546023d6e76967 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 1 Jun 2023 12:08:51 -0600 Subject: [PATCH] Replace join with left join in pertinent eloquent query --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 03fa8a4457..1d7595e5d9 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1667,7 +1667,7 @@ class Asset extends Depreciable public function scopeOrderManufacturer($query, $order) { return $query->join('models as order_asset_model', 'assets.model_id', '=', 'order_asset_model.id') - ->join('manufacturers as manufacturer_order', 'order_asset_model.manufacturer_id', '=', 'manufacturer_order.id') + ->leftjoin('manufacturers as manufacturer_order', 'order_asset_model.manufacturer_id', '=', 'manufacturer_order.id') ->orderBy('manufacturer_order.name', $order); }