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(laravel): boolean filter #6806

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Conversation

adryyy10
Copy link
Contributor

Adding new boolean filter in order to filter by boolean attributes

@soyuka
Copy link
Member

soyuka commented Nov 22, 2024

Could you add a test (like https://github.com/api-platform/core/blob/main/src/Laravel/Tests/Eloquent/Filter/DateFilterTest.php)?
Thanks!

@adryyy10 adryyy10 changed the title feat: Adding boolean filter feat: adding boolean filter Dec 9, 2024
@adryyy10 adryyy10 requested a review from soyuka December 9, 2024 17:03
@soyuka
Copy link
Member

soyuka commented Dec 10, 2024

There were missing a few things, I've added a test and registered the filter (https://github.com/api-platform/core/pull/6806/files#diff-1f34d8685c9bbcc2037ef47c41cb6dac916a0fe6fc06e2047b9635e35fa13527R423) I'll rebase this later. As you can see adding a functional test really helped to check it's working properly.

@adryyy10
Copy link
Contributor Author

There were missing a few things, I've added a test and registered the filter (https://github.com/api-platform/core/pull/6806/files#diff-1f34d8685c9bbcc2037ef47c41cb6dac916a0fe6fc06e2047b9635e35fa13527R423) I'll rebase this later. As you can see adding a functional test really helped to check it's working properly.

Thanks for the feedback

@soyuka
Copy link
Member

soyuka commented Dec 11, 2024

needs #6860

@soyuka soyuka changed the title feat: adding boolean filter feat(laravel): boolean filter Dec 13, 2024
@soyuka soyuka merged commit c78ed0b into api-platform:main Dec 13, 2024
58 of 59 checks passed
@soyuka
Copy link
Member

soyuka commented Dec 13, 2024

thanks @adryyy10!

vinceAmstoutz pushed a commit to vinceAmstoutz/api-platform-core that referenced this pull request Dec 24, 2024
* feat: Adding boolean filter

* refactor: return early if wrong values

* tests: boolean filter test

* refactor(BooleanFilter): cs fixer

* add test

---------

Co-authored-by: adriafigueres <[email protected]>
Co-authored-by: soyuka <[email protected]>
@vinceAmstoutz
Copy link
Contributor

@adryyy10, could you please add a documentation PR for this feature, targeting the main branch in this file: https://github.com/api-platform/docs/blob/main/laravel/filters.md?

Check our CONTRIBUTING Guide and do not hesitate if you need help.

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.

4 participants