diff --git a/src/HasTranslations.php b/src/HasTranslations.php index 67f0dc6..b257c94 100644 --- a/src/HasTranslations.php +++ b/src/HasTranslations.php @@ -341,4 +341,24 @@ public function scopeWhereLocales(Builder $query, string $column, array $locales } }); } + + /** + * @deprecated + */ + public static function whereLocale(string $column, string $locale): Builder + { + return static::query()->whereNotNull("{$column}->{$locale}"); + } + + /** + * @deprecated + */ + public static function whereLocales(string $column, array $locales): Builder + { + return static::query()->where(function (Builder $query) use ($column, $locales) { + foreach ($locales as $locale) { + $query->orWhereNotNull("{$column}->{$locale}"); + } + }); + } }