Scribe可以帮助您自动生成文档,但是如果您真的想制作友好,可维护和可测试的API文档,则还需要了解更多信息。所以我为你做了一门课程。🤗

shalvah 6f7a691b24 Infer URL parameter type from injected model (fixes #151) 4 years ago
.github 5a5e67c17c Update bug_report.md 4 years ago
camel 471cd72786 Back to 7.4 because of spatie/dto 4 years ago
config f3bb761fee Support more validation rules 4 years ago
docs 9704c428f7 Simplify Dingo detection 4 years ago
resources 5433e4ba15 Implement inline validator support 4 years ago
routes 6f7a691b24 Infer URL parameter type from injected model (fixes #151) 4 years ago
src 6f7a691b24 Infer URL parameter type from injected model (fixes #151) 4 years ago
tests 6f7a691b24 Infer URL parameter type from injected model (fixes #151) 4 years ago
.editorconfig 24d3f6aa22 Add some dotfiles 9 years ago
.gitattributes 6e60d14ea2 Make bodyParam parsing more rbust 6 years ago
.gitignore a81b4a86b9 Refactor tests 5 years ago
.travis.yml 9704c428f7 Simplify Dingo detection 4 years ago
CHANGELOG-1.x.md 516a96cf49 Switch to DTOs for parsing and writing Postman/OpenAPI 4 years ago
CHANGELOG-2.x.md 5433e4ba15 Implement inline validator support 4 years ago
CHANGELOG.md f3bb761fee Support more validation rules 4 years ago
CONTRIBUTING.md 6457ea46f4 Add contribution guide 5 years ago
LICENSE.md 437504e237 Update license 4 years ago
README.md 9704c428f7 Simplify Dingo detection 4 years ago
composer.dingo.json 9704c428f7 Simplify Dingo detection 4 years ago
composer.json 5433e4ba15 Implement inline validator support 4 years ago
logo-scribe.png 908fd36b04 Update doc 5 years ago
phpstan.neon d59b274988 Fix lint 4 years ago
phpunit.xml 5433e4ba15 Implement inline validator support 4 years ago

README.md

Scribe


Still on v1? Here's the v2 migration guide.

Generate API documentation for humans from your Laravel codebase. Here's what the output looks like. There's a Node.js version, too!

Latest Stable Version Total Downloads Build Status

👋 Scribe helps you generate docs automatically, but if you really want to make friendly, maintainable and testable API docs, there's some more things you need to know. So I made a course for you.🤗

Features

  • Pretty HTML documentation page, with included code samples and friendly text
  • Included "Try It Out" button so users can test endpoints right from their browser
  • Markdown source files that can be edited to modify docs
  • Extracts body parameters information from Laravel FormRequests
  • Safely calls API endpoints to generate sample responses, with authentication and other custom configuration supported
  • Supports generating responses from Eloquent API Resources or Fractal Transformers
  • Supports Postman collection and OpenAPI (Swagger) spec generation
  • Included UI components for additional styling
  • Easily customisable with custom views
  • Easily extensible with custom strategies

Documentation

See the migration guide if you're coming from mpociot/laravel-apidoc-generator.

Check out the documentation at ReadTheDocs.

Installation

PHP 7.4 and Laravel/Lumen 6.0 or higher are required.

composer require --dev knuckleswtf/scribe

Laravel

Publish the config file by running:

php artisan vendor:publish --provider="Knuckles\Scribe\ScribeServiceProvider" --tag=scribe-config

This will create a scribe.php file in your config folder.

Lumen

  • When using Lumen, you will need to run composer require knuckleswtf/scribe instead (no --dev).
  • Register the service provider in your bootstrap/app.php:
$app->register(\Knuckles\Scribe\ScribeServiceProvider::class);
  • Copy the config file from vendor/knuckleswtf/scribe/config/scribe.php to your project as config/scribe.php. Then add to your bootstrap/app.php:
$app->configure('scribe');

Contributing

Contributing is easy! See our contribution guide.