• Stars
    star
    647
  • Rank 66,835 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 2 years ago
  • Updated 22 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Effortless API documentation tool for Laravel applications. Swagger alternative.

Laravel Request Docs

The Hassle-Free automatic API documentation generation for Laravel.
A Swagger alternative.
Supports Open API 3.0.0

Try latest DEMO!

CI Node CI PHP codecov Latest Stable Version Total Downloads License

Fast Install on any Laravel Project

Hassle Free Auto Generate API Documentation for request rules and parameters

Analyze Inbuilt SQL query time analyzer, response time and headers output.

Supports Postman and OpenAPI 3.0.0 exports.

Features

  • Light and Dark mode
  • Automatic rules fetching from injected Request and by regexp
  • Automatic routes fetching from Laravel Routes
  • Support for Laravel logs
  • Support for SQL query and query time
  • Support for HTTP response time and memory consumption
  • Support for Authorization Headers
  • Support for File uploads
  • Support for Eloquents events
  • Display extra documentation using markdown
  • Saves history previous requests
  • Added filters to sort, group and filter routes by methods, controllers, middlewares, routes
  • Export Laravel API, routes, rules and documentation to Postman and OpenAPI 3.0.0

Read on Medium

Automatically generate API documentation for Laravel without writing annotations.

Read more: https://medium.com/web-developer/laravel-automatically-generate-api-documentation-without-annotations-a-swagger-alternative-e0699409a59e

Requirements

Lang Versions
PHP 7.4 or 8.0 or 8.1 or 8.2
Laravel 6.* or 8.* or 9.* or 10.*

Installation

You can install the package via composer:

composer require rakutentech/laravel-request-docs

You can publish the config file with:

php artisan vendor:publish --tag=request-docs-config
php artisan route:cache

# Optional publish assets
# php artisan vendor:publish --tag=request-docs-assets

(optional) Add the following middleware to your API, so that the SQL logs and model events are captured.

app/Http/Kernel.php

        'api' => [
            ...
            \Rakutentech\LaravelRequestDocs\LaravelRequestDocsMiddleware::class,
            ... and so on

Usage

Dashboard

View in the browser on /request-docs/

Design pattern

For this plugin to work, you need to follow the design pattern by injecting the request class inside the controller. For extra documentation you can use markdown inside your controller method as well.

Design pattern

Screenshots

Dark and Light Modes

  • Uses local storage to save the history of previous requests and request headers.
  • Request, SQL, response and events timeline below:

Settings to sort, group and filter

Extra

You write extra documentation in markdown which will be rendered as HTML on the dashboard. Example of using it in the controller

    /**
     * @lrd:start
     * Hello markdown
     * Free `code` or *text* to write documentation in markdown
     * @lrd:end
     */
    public function index(MyIndexRequest $request): Resource
    {

Params not in rules

You write extra params with rules with @LRDparam in the comment line as one line

    /**
     * @LRDparam username string|max:32
     * // either space or pipe
     * @LRDparam nickaname string|nullable|max:32
     * // override the default response codes
     * @LRDparam responses 200,422
     */
    public function index(MyIndexRequest $request): Resource
    {

Testing

./vendor/bin/phpunit

Linting

./vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=tests/migrations config/ src/

Fixing lints

./vendor/bin/php-cs-fixer fix src/
./vendor/bin/php-cs-fixer fix config/

Star History

Star History Chart

Changelog

  • Initial Release
  • v1.9 Added improvements such as status code, response headers, custom request headers and fixed issues reported by users
  • v1.10 Show PHP memory usage, gzip encoding fix
  • v1.12 Bug fix of id, and Laravel 9 support
  • v1.13 Laravel 9 support
  • v1.15 Adds Filter and fall back to regexp upon Exception
  • v1.17 Do not restrict to FormRequest
  • v1.18 Fix where prism had fixed height. Allow the text area resize.
  • v1.18 Updated UI and pushed unit tests
  • v1.19 Exception -> Throwable for type error
  • v1.20 Feature support open api 3.0.0 #10
  • v1.21 Ability to add custom params
  • v1.22 Boolean|File|Image support
  • v1.22 Boolean|File|Image support
  • v1.23 Bug fix for LRD doc block #76
  • v1.27 A few fixes on width and added request_methods
  • v2.0 UI Renewal to React Static
    • @QAParam is now @LRDparam
    • No special changes for users, upgrade to v2.x as usual
    • Upgrading users will need to republish config
  • v2.1 UI - adds search bar and few alignment fixes on table
  • v2.2 PHP 8.1 and 8.2 support added - Groupby enabled for routes and controllers
  • v2.3 Bug fix for local storage (tabs) and full UI refactored after alpha
  • v2.4 Show version on navbar and curl is using ace editor
  • v2.5 Groupby final fix and local storage clear button. Other UI refactor
  • v2.6 File uploads
  • v2.7 Show activity on Eloquent models
  • v2.8 Show full activity on Eloquent models
  • v2.13 Bug fixes, and nested params support
  • v2.14 Adds path params support
  • v2.16 Top Navbar is fixed
  • v2.19 Publish _astro assets

Contributors

More Repositories

1

AltSwiftUI

Open Source UI framework based on SwiftUI syntax and features, adding backwards compatibility.
Swift
295
star
2

macos-push-tester

Native mac app for easily sending Apple APNs push notifications to iOS apps and FCM push notifications to Android apps.
Swift
110
star
3

terraform-provider-vsphere

[DEPRECATED] Terraform Custom Provider for VMware vSphere
Go
82
star
4

r10

R10 is a library of interactive building blocks written in Elm and elm-ui that we use at Rakuten for creating user interfaces.
Elm
73
star
5

android-miniapp

Mini App SDK for Android Apps
Kotlin
72
star
6

stAdv

Spatially Transformed Adversarial Examples with TensorFlow
Python
71
star
7

ios-miniapp

Mini App SDK for iOS Apps
Swift
42
star
8

http-trinity

An Elm library that add extra features to the official elm/http library.
Elm
35
star
9

rakutentech.github.io

Rakuten Technology Page
Elm
32
star
10

ios-perftracking

Performance Tracking for iOS Apps
Objective-C
32
star
11

js-miniapp

Mini App SDK for JavaScript
JavaScript
28
star
12

code-coverage-dashboard

Effective Code Coverage Tracking and Dashboard.
Go
26
star
13

PCT-Net-Image-Harmonization

Python
25
star
14

jwkgen

Small command-line tool that generates asymmetric JSON Web Keys for the following algorithms and curves
Go
25
star
15

cf-plugin-local-push

CloudFoundry plugin local push (deploying CF application on local docker container with buildpack)
Go
24
star
16

ios-rresultbuilders

Open Source DSL framework based on @resultbuilder and swift 5.4 compatibility
Swift
24
star
17

cf-tools

Useful shell scripts for Cloud Foundry API v2
Shell
22
star
18

shibuya

JavaScript
21
star
19

android-buildconfig

Shared (gradle) build configurations for Android and Java libraries
Groovy
21
star
20

spark-dirty-cat

Similarity encoding of dirty categorical variables (strings)
Scala
19
star
21

FAU_CVPR2021

Python
18
star
22

jwk-go

Library for parsing, encoding and generating JSON Web Keys in Go
Go
17
star
23

go-alertnotification

Go Package to notify app alerts to Email and MS teams using Webhook
Go
17
star
24

android-perftracking

Performance Tracking for Android Apps
Java
17
star
25

iOS-CreditCardReader

Camera based library for SwiftUI, AltSwiftUI and UIKit with lightweight and accurate credit card information detection, and fully customizable UI controls.
Swift
17
star
26

dorna_arm_ros

Python
15
star
27

BayesianExperiments.jl

Bayesian AB testing experiments.
Julia
14
star
28

data-science-platform

Democratize AI and Data Science. Rapidly develop and deploy models that drive business impact.
HTML
14
star
29

kafka-firehose-nozzle

Forward logs from the Cloud Foundry Firehose to Apache Kafka
Go
13
star
30

ios-remote-config

Remote Config for iOS Apps https://rakutentech.github.io/ios-remote-config/
Swift
13
star
31

docpub

DocPub is a command line utility for converting a folder structure of markdown files to HTML and uploading the result to Zendesk.
JavaScript
12
star
32

jndi-ldap-test-server

A minimalistic LDAP server that is meant for test vulnerability to JNDI+LDAP injection attacks in Java, especially CVE-2021-44228.
Go
10
star
33

kong-plugin-graphql-operation-whitelist

Whitelist operations that your consumers can send to your GraphQL server.
Lua
9
star
34

grapesjs-angular

GrapesJS Angular is an Angular wrapper around the GrapesJS library, it allows instantiating an Angular component containing the GrapesJS editor, as well as all of its managers accessible as Angular Injectables.
TypeScript
9
star
35

ByNet-SR

Pytorch Implementation of ICIP2017 Paper: “ByNet-SR: Image Super Resolution with a Bypass Connection Network”
Python
8
star
36

go-echo-kit

A collection of supportive functions for go-echo development
Go
8
star
37

go-nozzle

Golang package for building CloudFoundry nozzle
Go
7
star
38

github-enterprise-cookbook

Github Enterprise Chef Cookbook
Ruby
7
star
39

passenger-go-exporter

Passenger status monitoring agent for Prometheus.
Go
7
star
40

ios-buildconfig

Shared build configuration and tooling for iOS SDK development
JavaScript
7
star
41

engineering-blog

Sources of https://engineering.rakuten.today/
HTML
7
star
42

dotfiles-boshrelease

Perl
7
star
43

simple-autoscaler

Stateless autoscaler for Cloud Foundry applications
Go
6
star
44

android-inappmessaging

In-App Messaging SDK for Android Apps
Kotlin
6
star
45

ios-sdkutils

iOS library with utilities for SDK developers https://rakutentech.github.io/ios-sdkutils
Swift
6
star
46

android-manifest-config

Annotation processor that generates a class to lookup manifest metadata.
Java
6
star
47

android-sdkutils

Android library with utilities for SDK developers
Kotlin
6
star
48

kong-plugin-graphql-depth-limit

Limit the complexity of GraphQL queries based on their depth.
Lua
6
star
49

mobile-sdk-guidelines

Rakuten MAG SDK Team guidelines for developing mobile SDKs
6
star
50

arduino_blv640

Arduino-compatible driver library for the Oriental Motor BLV-Series motors
C++
5
star
51

cf-plugin-update-cli

CloudFoundry plugin update-cli (update cloudfoundry/cli to the latest version)
Go
5
star
52

dotconf-assist

dotconf-assist is a Web GUI and REST API Designed for Splunk Configuration Management
HTML
5
star
53

Document-understanding

Python
5
star
54

ios-inappmessaging

In-App Messaging SDK for iOS Apps https://rakutentech.github.io/ios-inappmessaging/
Swift
5
star
55

ios-crash-reporting

Crash Reporting for iOS Apps
Objective-C
5
star
56

plantuml-docker

Docker image for running a PlantUML server using the Rakuten theme
Dockerfile
5
star
57

parfind

A parallel, simplified version of find(1) for use on high-latency, highly-parallel file systems.
Go
5
star
58

postgres-backup-boshrelease

Monit scripts adding backup jobs to cron
Shell
4
star
59

rmn-website

Rakuten Mindfulness Network website
CSS
4
star
60

nrp

Python
4
star
61

cf-metrics-refinery

Enrich and store in InfluxDB metrics of applications deployed on Cloud Foundry
Go
4
star
62

android-remote-config

Remote Config for Android apps
Kotlin
4
star
63

barcode

Super-lightweight barcode generation library for Android and iOS
Objective-C
4
star
64

chart-synthesizer

Python
4
star
65

pisah

Sentence Splitter Library (C++ port of pySBD)
C++
4
star
66

Rakuten-Unified-Memory

A Distributed Data Grid using User-Space Networking
C++
4
star
67

bosh-routing-release

BOSH release that changes the route table and the default gateway.
3
star
68

java-datastore

Simple local blob storage with support for encryption
Java
3
star
69

go-domo-api

Go
3
star
70

shared_rep

Python
3
star
71

hq

Python
3
star
72

android-crash-reporting

Crash Reporting for Android devices
Java
3
star
73

magga

Open Source Mobile Platform for Learning
2
star
74

node-alertnotification

JavaScript
2
star
75

android-analytics

Records user activity and automatically sends tracking events to an analytics cloud service.
2
star
76

api-automation-tools

Python
2
star
77

MTL_onlineKD_WACV2023

Python
2
star
78

redis-twemproxy-agent

Ruby
2
star
79

rbot

Rakuten Robotics Base Toolkit (Rbot)
C++
2
star
80

StateDesignEngine

JavaScript
1
star
81

leofs_docs

CSS
1
star
82

jenkins_support_tool

PHP
1
star
83

ui-automation-tools-mbt

Python
1
star
84

esquisite

A library of exquisite helpers and utilities for ES apps.
JavaScript
1
star
85

homebrew-tap

Homebrew tap for Rakuten Open Source apps
Ruby
1
star
86

mimo

Chef cookbook for Mimo https://github.com/shutterfly/Mimo
Ruby
1
star
87

ios-analytics-framework

SDK that records user activity and automatically sends tracking events to an analytics cloud service.
Ruby
1
star
88

go-watch-logs

Go
1
star
89

chef_java_libs

Java Libraries Chef Cookbook
Ruby
1
star
90

cocoapods-cordova-plugins

Ruby
1
star
91

gradle-cordova-plugins

Groovy
1
star