承接 exonn-gmbh/scramble-spatie-query-builder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

exonn-gmbh/scramble-spatie-query-builder

最新稳定版本:v1.0.5

Composer 安装命令:

composer require 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

README 文档

README

Preview

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

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

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
],
  1. You are done, now check your Scramble docs for routes that use Spatie query builder, you should see new query parameters documented

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');
    });
}
  1. Customize for your needs

统计信息

  • 总下载量: 4.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固