PHPackages                             bbim/query-scoper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. bbim/query-scoper

ActiveLibrary[Search &amp; Filtering](/categories/search)

bbim/query-scoper
=================

Laravel query scoping library for dynamic filtering

04PHP

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/Ahmedd-Ibrahim/Query-scoper)[ Packagist](https://packagist.org/packages/bbim/query-scoper)[ RSS](/packages/bbim-query-scoper/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

QueryScoper - Laravel Dynamic Query Filtering
=============================================

[](#queryscoper---laravel-dynamic-query-filtering)

A powerful Laravel package for dynamic query filtering and scoping with multiple drivers support.

Features
--------

[](#features)

- 🔍 Dynamic query filtering
- 🎯 Multiple scope drivers
- 📊 Eloquent and Query Builder support
- 🔧 Flexible configuration
- 🧪 Easy testing integration
- 🚀 High performance

Installation
------------

[](#installation)

```
composer require bbim/query-scoper
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Bbim\QueryScoper\Providers\QueryScoperServiceProvider"
```

Architecture
------------

[](#architecture)

### Drivers

[](#drivers)

- **EloquentDriver**: Manages scopes for Eloquent queries
- **QueryBuilderDriver**: Manages scopes for Query Builder queries

### Scopes

[](#scopes)

Each scope is a class that extends `QueryScoper` and implements:

- `prepareData()`: Extract data from request
- `validator()`: Validate the data
- `prepareBuilder()`: Apply conditions to the query

Usage
-----

[](#usage)

### 1. Creating a Scope

[](#1-creating-a-scope)

```
