appointer/swaggervel
最新稳定版本:v2.5
Composer 安装命令:
composer require appointer/swaggervel
包简介
A great way to integrate Swagger into Laravel
README 文档
README
This package combines Swagger-php and swagger-ui into one Laravel-friendly package. When you run your app in debug mode, Swaggervel will scan your app folder (or any folder that is set under the "app-dir" variable in the packages config), generate swagger json files and deposit them to the doc-dir folder (default is /docs). Files are then served by swagger-ui under the api-docs director.
Installation
- Execute
composer require appointer/swaggervel --devwithin your laravel root directory - Add
Appointer\Swaggervel\SwaggervelServiceProvider::classto your providers array inapp/config/app.phpabove your route provider, to avoid any catch-all routes - Run
php artisan vendor:publish --tag=publicto push swagger-ui to your public folder (can be found in public/vendor/swaggervel). - Optionally run
php artisan vendor:publish --tag=configto push the swaggervel default config into your application's config directory. - Optionally run
php artisan vendor:publish --tag=viewsto push the swaggervel index view file intoresources/views/vendor/swaggervel.
Examples (when using the default configuration)
- www.example.com/docs <- You may find your automatically generated Swagger .json-File there
- www.example.com/api/docs <- Access to your Swagger UI
Options
All options are well commented within the swaggervel.php config file.
How to Use Swagger-php
The actual Swagger spec is beyond the scope of this package. All Swaggervel does is package up swagger-php and swagger-ui in a Laravel-friendly fashion, and tries to make it easy to serve. For info on how to use swagger-php look here. For good examples of swagger-php in action look here.
Further Notes
This package is a fork of slampenny/Swaggervel, as it is no longer maintained.
TODO
- the handling of the /doc call is still really inconsistent, as you cannot change the file name (api-docs.json), but are able to change the file you acces when using the /doc route.
appointer/swaggervel 适用场景与选型建议
appointer/swaggervel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 306.86k 次下载、GitHub Stars 达 65, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「documentation」 「api」 「laravel」 「swagger」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 appointer/swaggervel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 appointer/swaggervel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 appointer/swaggervel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
Laravel package that generates RESTful API documentation in Markdown based on PHPDoc.
A PSR-7 compatible library for making CRUD API endpoints
Laravel API documentation generating tool
Alfabank REST API integration
RESTful API server for structured and self-documenting resources over JSON, XML, ...
统计信息
- 总下载量: 306.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 65
- 点击次数: 14
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04