Download the PHP package zaruto/scramble-spatie-query-builder without Composer
On this page you can find all versions of the php package zaruto/scramble-spatie-query-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package scramble-spatie-query-builder
Scramble extension for Spatie Query Builder
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
After you publish the package on Packagist:
Until the package is published, install it directly from your GitHub repository:
Then run:
Supported baseline:
- PHP
^8.3 dedoc/scramble^0.13.16spatie/laravel-query-builder^7.0.1- Laravel 12 test/dev stack
Usage
-
Register the extension in your
config/scramble.phpfile. -
Use Spatie Query Builder in your controller or route action as usual.
- Open your Scramble docs. For routes that use Spatie Query Builder, the extension will add query parameters such as:
fieldsfilterincludesortfilter_modewhenAllowedFilterModesExtensionis enabled
- Example query string:
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
-
Open your and add the following code example in the method
- Customize for your needs
Publishing
To publish this as your own package:
- Create a public GitHub repository named
scramble-spatie-query-builderunder yourzarutoaccount. - Push this code to
https://github.com/zaruto/scramble-spatie-query-builder. - Sign in to Packagist with your GitHub account.
- Submit the repository URL to Packagist.
- After Packagist indexes the repository, install it with
composer require zaruto/scramble-spatie-query-builder. - Add the Packagist service hook in GitHub so new tags and releases are picked up automatically.
All versions of scramble-spatie-query-builder with dependencies
dedoc/scramble Version ^0.13.16
spatie/laravel-query-builder Version ^7.0.1