Fix the getters in Cart model for a city, a company.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-06-20 17:34:35 +03:00
parent d584379888
commit d5cd9f4096
+2 -2
View File
@@ -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