Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abbasudo/laravel-purity
An elegant way to filter and sort queries in Laravel
https://github.com/abbasudo/laravel-purity
eloquent filter filtering filters laravel mysql php queries sort sql
Last synced: 2 days ago
JSON representation
An elegant way to filter and sort queries in Laravel
- Host: GitHub
- URL: https://github.com/abbasudo/laravel-purity
- Owner: abbasudo
- License: mit
- Created: 2023-02-20T00:52:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-29T18:33:40.000Z (15 days ago)
- Last Synced: 2024-10-29T20:35:59.731Z (15 days ago)
- Topics: eloquent, filter, filtering, filters, laravel, mysql, php, queries, sort, sql
- Language: PHP
- Homepage: https://abbasudo.github.io/laravel-purity/?utm_source=github&utm_medium=about
- Size: 1.18 MB
- Stars: 464
- Watchers: 5
- Forks: 43
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Elegant way to filter and sort queries in Laravel
[![Tests](https://github.com/abbasudo/laravel-purity/actions/workflows/tests.yml/badge.svg)](https://github.com/abbasudo/laravel-purity/actions/workflows/tests.yml)
[![License](http://poser.pugx.org/abbasudo/laravel-purity/license)](https://github.com/abbasudo/laravel-purity)
[![Latest Unstable Version](http://poser.pugx.org/abbasudo/laravel-purity/v)](https://packagist.org/packages/abbasudo/laravel-purity)
[![PHP Version Require](http://poser.pugx.org/abbasudo/laravel-purity/require/php)](https://packagist.org/packages/abbasudo/laravel-purity)
[![StyleCI](https://github.styleci.io/repos/603931433/shield)](https://packagist.org/packages/abbasudo/laravel-purity)Laravel Purity is an elegant and yet simple filtering and sorting package for Laravel,
designed to simplify complex data filtering and sorting logic for eloquent queries.
By simply adding `filter()` to your Eloquent query,
you can add the ability for frontend users to apply filters based on URL query string parameters like a breeze.## How Does Purity Work?
Here is a basic usage example to clarify Purity's use case.Add `filter()` to your query.
```php
$posts = Post::filter()->get();
```
That's it!
Now you can filter your posts by adding query string parameters to the URL.
```
GET /api/posts?filters[title][$contains]=Purity
```
read more at official [documentations](https://abbasudo.github.io/laravel-purity/)## Documentation
https://abbasudo.github.io/laravel-purity/## License
Laravel Purity is Licensed under The MIT License (MIT). Please see [License File](https://github.com/abbasudo/laravel-purity/blob/master/LICENSE) for more information.
## Security
If you've found a bug regarding security, please mail [[email protected]](mailto:[email protected]) instead of
using the issue tracker.