Download the PHP package dcat-plus/apidocs without Composer

On this page you can find all versions of the php package dcat-plus/apidocs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apidocs

dcat-plus/apidocs

基于 Laravel 8 的轻量 API 文档生成包(兼容 PHP 7.4)。

当前版本重点:基于控制器注释提取文档,输出 OpenAPI 3.0.3 JSON。

支持的注释标签

DcatPlus Attributes

支持从以下 PHP Attributes 提取文档信息(无需额外迁移注释):

说明:同名参数下,显式注释(DocBlock)优先,Attributes 次之,validate 推断最后兜底。

注意:Attributes 解析依赖 PHP 8+ 的反射能力;在 PHP 7.4 运行时会自动忽略 Attributes,仅保留注释与 validate 推断。

认证推断规则:

用法

  1. 发布配置

  2. 生成 JSON 文件

  3. 在线查看

Stoplight UI 功能

文档页使用 Stoplight Elements 渲染 OpenAPI,并额外内置了接口搜索。

接口搜索

默认开启。打开 /docs/apidocs 后,右上角会出现搜索框,可按以下内容搜索:

搜索结果支持点击跳转到对应接口,也可以输入关键词后按 Enter 打开第一个结果,按 Esc 关闭结果面板。

如需关闭搜索,可在配置中设置:

常用 UI 配置

说明:

导出 OpenAPI JSON

默认开启。文档页右上角会显示“导出 JSON”按钮,打开当前文档的 OpenAPI JSON 地址,默认是 /docs/apidocs.json。

如需关闭:

环境切换 servers

OpenAPI 的 servers 会被 Stoplight 用于在线调试环境。配置多个环境后,文档页右上角会显示环境下拉框,切换后会把选中的 server 放到 OpenAPI servers 列表首位,让 Try It 默认使用该环境。

也可以使用 OpenAPI 原生写法:

如需关闭右上角环境切换:

分组/标签优化

推荐使用 DcatPlus\Apidocs\Attributes\Group 标记控制器或方法分组。分组会转换成 OpenAPI tags,Stoplight 左侧目录会按 tags 组织接口。

Group 的第三个参数是排序值,数字越小越靠前。方法上的 Group 优先级高于类上的 Group。

生成器会把分组说明写入 OpenAPI tags.description,并按 weight 和路径整理 OpenAPI tags、paths,让左侧目录更稳定。未设置排序值的分组会排在后面,并按名称排序。

隐藏内部接口

给控制器方法 DocBlock 添加 @internal 后,该接口默认不会出现在文档和 JSON 中。

如需临时生成内部接口文档,可开启:

注释示例

访问控制

扫描范围

优先使用核心配置:

兼容配置:


All versions of apidocs with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
illuminate/support Version ^8.75
illuminate/routing Version ^8.75
illuminate/console Version ^8.75
illuminate/filesystem Version ^8.75
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dcat-plus/apidocs contains the following files

Loading the files please wait ...