Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] add ability for filtering a column's locale or multiple locale… #447

Merged
merged 2 commits into from
May 13, 2024

Conversation

AbdelrahmanBl
Copy link
Contributor

Add ability for filter a translatable json column with a value depending on it's locale or multiple locales
for example:

// Returns all news items that has name in English with value `Name in English` 
NewsItem::query()->whereJsonContainsLocale('name', 'en', 'Name in English')->get(); 

// Returns all news items that has name in English or Dutch with value `Name in English` 
NewsItem::query()->whereJsonContainsLocales('name', ['en', 'nl'], 'Name in English')->get();

@freekmurze
Copy link
Member

It seems like the tests are failing, could you take a look?

@AbdelrahmanBl
Copy link
Contributor Author

Yes the problem seems to appear when testing on a sqlite driver and i solved the problem to work on all drivers.

@freekmurze freekmurze merged commit b75b330 into spatie:main May 13, 2024
19 checks passed
@freekmurze
Copy link
Member

Thanks!

@AbdelrahmanBl
Copy link
Contributor Author

You are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants