承接 3sidedcube/laravel-redoc 相关项目开发

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

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

3sidedcube/laravel-redoc

Composer 安装命令:

composer require 3sidedcube/laravel-redoc

包简介

A lightweight package for rendering API documentation using OpenAPI and Redoc.

README 文档

README

3 Sided Cube

Laravel Redoc

Latest Version on Packagist Total Downloads GitHub Actions

This package provides an easy way for rendering API documentation using OpenAPI and Redoc.

Requirements

  • PHP 7.4 or higher
  • Laravel 8.0 or higher

Composer will automatically ensure compatible versions:

  • PHP 7.4: Works with Laravel 8
  • PHP 8.0: Works with Laravel 8-9
  • PHP 8.1: Works with Laravel 8-10
  • PHP 8.2+: Works with Laravel 8-13

Installation

You can install the package via composer:

composer require 3sidedcube/laravel-redoc

Usage

Viewing the documentation

By default, the documentation is served at /docs/api and will load the openapi.json file from the openapi folder at the root of the project.

You can change the path used to serve the documentation by setting the redoc.path config option.

If you would like to change the directory where your openapi.json file is located, you can update redoc.directory config option.

Documentation versions

Laravel Redoc supports rendering multiple versions of documentation. If you would like to serve a different version of the documentation, you can include {version} in the redoc.path config option e.g. docs/{version}/api. This will then load the {version}.json file from the configured directory.

Variables

If you would like to replace a "variable" in the documentation, you can use the redoc.variables config option.

For example, if you would like to dynamically set the server url to the given environment, you could configure the following variable:

'variables' => [
    'server_url' => env('APP_URL'),
],

Now, when you use :server_url in the OpenAPI definition, it will be replaced with the value of the APP_URL.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

Laravel Redoc is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固