PHPackages                             a.sharifnezhad/api-doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. a.sharifnezhad/api-doc

ActiveLibrary[API Development](/categories/api)

a.sharifnezhad/api-doc
======================

1.0.0(2y ago)06MITPHP

Since Sep 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sharifnezhad/api-doc)[ Packagist](https://packagist.org/packages/a.sharifnezhad/api-doc)[ RSS](/packages/asharifnezhad-api-doc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

api-doc
=======

[](#api-doc)

[![apidoc](https://raw.githubusercontent.com/Rebilly/ReDoc/master/demo/redoc-demo.png)](https://raw.githubusercontent.com/Rebilly/ReDoc/master/demo/redoc-demo.png)

There is a saying that says when a wheel has already been made, why should you spend time and make the same wheel again? In response to this sentence, because I am curious, I would like to know the details of that wheel and build its structure myself.

You must have seen the api-doc package on various sites and directories, api-doc is a set of instructions and technical guides designed for developers and programmers. This documentation provides information on how to use the application programming interface (API), including how to send requests, parameters, and how the service responds. The api-doc documentation is designed to help developers correctly use a service or platform, improve understanding between developers and the API provider, and increase the efficiency and quality of application development.

Features
--------

[](#features)

- Ability to create documents for specific addresses
- The possibility of sending a request in the document and displaying the output
- Ability to define authentication information and access levels
- Ability to define and edit simulated codes

Installation
------------

[](#installation)

- Install package

    ```
    composer require a.sharifnezhad/api-doc

    ```
- Publish the config file by running

    ```
    php artisan vendor:publish --tag=apidoc-config

    ```

This will create an api-doc.php file in your config folder.

- By default, the document output is saved and updated in the `storage/app/public` directory. Because this directory is not public by default in Laravel, you need to run the following command to access it. ```
    php artisan storage:link

    ```

Configuration
-------------

[](#configuration)

- If you want to change the simulated codes or add another new language, follow the steps below:

    ```
    code_sample => [
        is_enable => true,
        'directory' => '',
        'language-tabs' => [
            'bash' => 'Bash',
            'javascript' => 'Javascript',
            'php' => 'PHP',
            ]
    ]

    ```

    - If you want this section to be displayed in the document or not, disable the `is_enable => true` in the apidoc configuration file.
    - If you add a new language, you must add the name of the file created in your view directory along with the desired name in the `language-tabs` section.
    - If you put the simulated codes in a special directory, in addition to running the following command: ```
        php artisan vendor:publish --tag=apidoc-code-sample

        ```

        After executing the above command, a directory called CodeSamples will be created in the `resources/views` directory. After the directory is added, it is necessary to add the name of the directory in the `directory` section, which is written here as `'directory' => 'CodeSamples'`.
- How to add microservice authentication information is as follows: To add authentication information, you can add all of it in the `security` section, in the following I will give some examples that you can follow to start your cartoon.

    - Bearer token ```
        'BearerAuth' => [
            'type' => 'http',
            'scheme' => 'bearer',
            'bearerFormat' => 'JWT',
            'in' => 'header'
        ],

        ```
    - oauth2 ```
        "oauth2" => [
            "type" => "oauth2",
            "flows" => [
                "implicit" => [
                    "authorizationUrl" => "https=>//example.com/oauth/authorize",
                    "scopes" => [
                        "read" => "Grants read access to resources",
                        "write" => "Grants write access to resources",
                        "admin" => "Grants administrative access to resources"
                    ],
                ],
            ],
        ],

        ```
    - apiKey ```
        "apiKey" => [
            "type" => "apiKey",
            "name" => "X-API-Key",
            "in" => "header"
        ],

        ```
    - basicAuth ```
        "basicAuth" => [
            "type" => "http",
            "scheme" => "basic"
        ],

        ```
- If you want the document property to be written from the root, it is only necessary to write its endpoint name as below

    ```
    'routes' => [
        'prefixes' => [
            'api/'
        ],
    ],

    ```

If you want all your routes to include documents, you should put `*` instead of `api/`

Usage
-----

[](#usage)

```
php artisan apidoc:generate

```

Documenting your API
--------------------

[](#documenting-your-api)

This package uses these resources to generate the API documentation:

### Grouping endpoints

[](#grouping-endpoints)

This package uses the HTTP controller doc blocks to create a table of contents and show descriptions for your API methods.

Using `@group` in a controller doc block creates a Group within the API documentation. All routes handled by that controller will be grouped under this group in the sidebar. The short description after the `@group` should be unique to allow anchor tags to navigate to this section. A longer description can be included below.

> Note: using `@group` is optional. Ungrouped routes will be placed in a `general` group.

### Specifying request parameters

[](#specifying-request-parameters)

[![apidoc](https://camo.githubusercontent.com/3de93d7906275d504bc83c315d962e7edac6e461b6ad1a35c75be95a538af742/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6f7661632f696d6167652f75706c6f61642f76313535363636323836342f736861646f775f696d6167655f3130333033395f73737169726a2e706e67)](https://camo.githubusercontent.com/3de93d7906275d504bc83c315d962e7edac6e461b6ad1a35c75be95a538af742/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6f7661632f696d6167652f75706c6f61642f76313535363636323836342f736861646f775f696d6167655f3130333033395f73737169726a2e706e67)

To specify a list of valid parameters your API route accepts, use the `@bodyParam` and `@pathParam` annotations.

- The `@bodyParam` annotation takes the name of the parameter
- The `@pathParam` annotation takes the name of the parameter

```
/**
 * @group Items
 */
class GetPostController extends Controller
{
    /**
     * Store2121 item
     *
     * Add a new item to the items collection.
     * @bodyParam {
     *      "key":"name",
     *       "type":"string",
     *        "description":"The name of the item. Example: Samsung Galaxy s10",
     *         "example":"Samsung Galaxy s10"
     * }
     * @bodyParam {
     *      "key":"name2",
     *       "type":"string",
     *       "required":true,
     *        "description":"The name of the item. Example: Samsung Galaxy s10",
     *         "example":"Samsung Galaxy s10"
     * }
     * @response {
     *      "status": 302,
     *      "success": true,
     *      "data": {
     *          "id": 10,
     *          "price": 100.00,
     *          "name": "Samsung Galaxy s10"
     *      }
     * }
     **/
    public function test()
    {

    }
}

```

### Indicating auth status

[](#indicating-auth-status)

You can use the `@authenticated` annotation on a method to indicate if the endpoint is authenticated. A field for authentication token will be made available and marked as required on the interractive documentation.

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

972d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff82f3199ecf872d09aedde8a67958ebc8364d7fee0f01184b0c22d536b68a79?d=identicon)[sharifnezhad](/maintainers/sharifnezhad)

---

Top Contributors

[![sharifnezhad](https://avatars.githubusercontent.com/u/83763809?v=4)](https://github.com/sharifnezhad "sharifnezhad (2 commits)")

### Embed Badge

![Health badge](/badges/asharifnezhad-api-doc/health.svg)

```
[![Health](https://phpackages.com/badges/asharifnezhad-api-doc/health.svg)](https://phpackages.com/packages/asharifnezhad-api-doc)
```

###  Alternatives

[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[mpociot/laravel-apidoc-generator

Generate beautiful API documentation from your Laravel application

3.5k3.1M12](/packages/mpociot-laravel-apidoc-generator)[ovac/idoc

Generate beautiful API documentation from your Laravel application

184477.6k2](/packages/ovac-idoc)[asseco-voice/laravel-open-api

Laravel OpenAPI generator

106.4k](/packages/asseco-voice-laravel-open-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
