PHPackages                             exonn-gmbh/scramble-spatie-query-builder - 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. [API Development](/categories/api)
4. /
5. exonn-gmbh/scramble-spatie-query-builder

ActiveLibrary[API Development](/categories/api)

exonn-gmbh/scramble-spatie-query-builder
========================================

This is the Scramble extension, which detects the usage of the Spatie query builder and adds applicable query parameters to the openapi definitions

v1.0.5(1y ago)123.9k↓28.6%7[1 issues](https://github.com/exonn-GmbH/scramble-spatie-query-builder/issues)[1 PRs](https://github.com/exonn-GmbH/scramble-spatie-query-builder/pulls)MITPHPPHP ^8.1

Since Sep 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/exonn-GmbH/scramble-spatie-query-builder)[ Packagist](https://packagist.org/packages/exonn-gmbh/scramble-spatie-query-builder)[ RSS](/packages/exonn-gmbh-scramble-spatie-query-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (14)Used By (0)

Scramble extension for Spatie Query Builder
===========================================

[](#scramble-extension-for-spatie-query-builder)

[![Preview](./.github/preview.png)](./.github/preview.png)

Introduction
------------

[](#introduction)

This is the Scramble extension, which detects the usage of the Spatie query builder in your api routes and automatically adds applicable query parameters to the openapi definition.

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

[](#installation)

```
composer require exonn-gmbh/scramble-spatie-query-builder

```

Usage
-----

[](#usage)

1. Register the extension in your `config/scramble.php` file

```
'extensions' => [
    // ...
    \Exonn\ScrambleSpatieQueryBuilder\AllowedFieldsExtension::class,
    \Exonn\ScrambleSpatieQueryBuilder\AllowedSortsExtension::class,
    \Exonn\ScrambleSpatieQueryBuilder\AllowedFiltersExtension::class,
    \Exonn\ScrambleSpatieQueryBuilder\AllowedIncludesExtension::class,
//    \Exonn\ScrambleSpatieQueryBuilder\AllowedFilterModesExtension::class
],
```

2. You are done, now check your Scramble docs for routes that use Spatie query builder, you should see new query parameters documented

Customization
-------------

[](#customization)

By default this extension automatically updates openapi definition for you, but if you want to customize its default behaviour, you can do it in the following way

1. Open your `AppServiceProvider.php` and add the following code example in the `boot` method

```
public function boot(): void
{
    // ...
    AllowedIncludesExtension::hook(function(Operation $operation, Parameter $parameter) {
        // Customize the example
        $parameter->example(['repositories.issues', 'repositories']);
        // Customize the description
        $parameter->description('Allows you to include additional model relations in the response');
    });
}
```

2. Customize for your needs

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance44

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

11

Last Release

435d ago

Major Versions

v0.9.2 → v1.0.02024-06-19

PHP version history (2 changes)v0.8.3PHP ^8.0

v1.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/27ff7d792ce25f53052e4038ee9041fad8ee0a76ab2f437a073fe29e59e381cf?d=identicon)[exonn GmbH](/maintainers/exonn%20GmbH)

---

Top Contributors

[![layerok](https://avatars.githubusercontent.com/u/18424848?v=4)](https://github.com/layerok "layerok (32 commits)")[![exonn-ozies](https://avatars.githubusercontent.com/u/146355503?v=4)](https://github.com/exonn-ozies "exonn-ozies (6 commits)")[![Kristories](https://avatars.githubusercontent.com/u/774338?v=4)](https://github.com/Kristories "Kristories (1 commits)")

---

Tags

apidocdedocextensionopenapiquery-builderscramblespatiespatieopenapiextensionquery builderscramble

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/exonn-gmbh-scramble-spatie-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/exonn-gmbh-scramble-spatie-query-builder/health.svg)](https://phpackages.com/packages/exonn-gmbh-scramble-spatie-query-builder)
```

###  Alternatives

[uderline/openapi-php-attributes

Automatically render your OpenApi 3 file describing your PHP API using attributes

2136.3k](/packages/uderline-openapi-php-attributes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
