states; } public function getNameAttribute($value) { return $value; } public function states() { return $this->hasMany(\Webkul\BagistoApi\Models\CountryState::class, 'country_id'); } /** * Get the default translation for the country * Note: This field is excluded from GraphQL to avoid null conflicts. * Use 'translations' (collection) instead to get all translations. */ public function getTranslation(?string $locale = null, ?bool $withFallback = null): ?\Illuminate\Database\Eloquent\Model { return parent::getTranslation($locale, $withFallback); } #[ApiProperty(readableLink: true, description: 'Translations for the country')] public function getTranslations() { return $this->getAttribute('translations') ?? parent::translations(); } }