Skip to content

Commit

Permalink
re-add old static methods with @Deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
gdebrauwer authored and freekmurze committed Jun 20, 2023
1 parent 2794a16 commit 29d08d2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/HasTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
});
}
}

0 comments on commit 29d08d2

Please sign in to comment.