From e13a268fe02574edbc4e69d5db1c1a6ef2c1ec3b Mon Sep 17 00:00:00 2001 From: Jitendra Singh Date: Fri, 10 Jan 2020 17:50:17 +0530 Subject: [PATCH] Eager loaded translations for country and country state models --- packages/Webkul/Core/src/Models/Country.php | 4 +++- packages/Webkul/Core/src/Models/CountryState.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/Webkul/Core/src/Models/Country.php b/packages/Webkul/Core/src/Models/Country.php index a9d6bbc38..1b6fbd783 100755 --- a/packages/Webkul/Core/src/Models/Country.php +++ b/packages/Webkul/Core/src/Models/Country.php @@ -7,7 +7,9 @@ use Webkul\Core\Contracts\Country as CountryContract; class Country extends TranslatableModel implements CountryContract { + public $timestamps = false; + public $translatedAttributes = ['name']; - public $timestamps = false; + protected $with = ['translations']; } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Models/CountryState.php b/packages/Webkul/Core/src/Models/CountryState.php index 321d8fb48..2115115aa 100755 --- a/packages/Webkul/Core/src/Models/CountryState.php +++ b/packages/Webkul/Core/src/Models/CountryState.php @@ -8,7 +8,9 @@ use Webkul\Core\Contracts\CountryState as CountryStateContract; class CountryState extends TranslatableModel implements CountryStateContract { - public $translatedAttributes = ['name']; - public $timestamps = false; + + public $translatedAttributes = ['name']; + + protected $with = ['translations']; } \ No newline at end of file