From d5cd9f409658dc0be1058ea0a23ba64576292766 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Tue, 20 Jun 2023 17:34:35 +0300 Subject: [PATCH] Fix the getters in Cart model for a city, a company. --- app/Models/Cart.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Cart.php b/app/Models/Cart.php index ed02efa..e005c23 100644 --- a/app/Models/Cart.php +++ b/app/Models/Cart.php @@ -28,7 +28,7 @@ class Cart extends Model public function getCity(): City { - return City::where('city_id', $this->city_id)->first(); + return City::where('id', $this->city_id)->first(); } public function company(): BelongsTo @@ -38,7 +38,7 @@ class Cart extends Model public function getCompany(): Company { - return Company::where('company_id', $this->company_id)->first(); + return Company::where('id', $this->company_id)->first(); } public function items(): BelongsToMany