PHPackages                             foryoufeng/laravel-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. foryoufeng/laravel-doc

ActiveLibrary[API Development](/categories/api)

foryoufeng/laravel-doc
======================

A tool for display docs or api docs to others

v1.0.3(5y ago)51.0k1MITBladeCI failing

Since Jun 29Pushed 5y agoCompare

[ Source](https://github.com/foryoufeng/laravel-doc)[ Packagist](https://packagist.org/packages/foryoufeng/laravel-doc)[ Docs](https://github.com/foryoufeng/laravel-doc)[ RSS](/packages/foryoufeng-laravel-doc/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

laravel-doc
===========

[](#laravel-doc)

[中文文档](readme_zh_CN.md)
-----------------------

[](#中文文档)

⛵`laravel-doc` is doc generator for laravel which can help you write document by markdown and you can access it by web

Requirements
------------

[](#requirements)

- PHP &gt;= 7.0.0
- Laravel &gt;= 5

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

[](#installation)

Via Composer

```
composer require foryoufeng/laravel-doc
```

If you do not run Laravel 5.5 (or higher), then add the service provider in `config/app.php`:

```
Foryoufeng\Doc\DocServiceProvider::class

```

You need to publish the resource files by run command

```

 php artisan doc:install

```

After run command you can find add many files in the project

```

/public/vendor/laravel-doc  //styles

/resources/views/docs   //views

/resources/mds/docs  //markdown doc files

/resources/mds/apidocs  //markdown apidoc files

/app/Http/Controllers/Docs  //Controllers

config/laravel_doc.php  //config

routes/web.php  //add access url in the route file

```

### to access the application

[](#to-access-the-application)

- access `/doc`,to see the document
- access`/apidoc`,to see the api doc document
- but they are write by Chinese language

How To Use
==========

[](#how-to-use)

General document
----------------

[](#general-document)

create your md file in the `resources/mds/docs`, such as`demo.md`,and add your content then to the`app/Http/Controllers/Docs/LaravelDocController.php`,find the method`index_md`to add data，such as：

```
private function index_md()
    {
        return  [
            [
                'name' => config('laravel_doc.languages.install'),
                'doc_link' => 'install.md',
            ],
            [
                'name' => config('laravel_doc.languages.how_use'),
                'doc_link' => 'how_use.md',
            ],
            [
                'name' => 'demo',
                'doc_link' => 'demo.md',
            ],
        ];
    }

```

access to `/doc`

Controller
==========

[](#controller)

the default path for docs to save

```
$this->mds_path=resource_path('mds/docs/');

```

- config menus

```
protected function getMenu()
    return [
                [
                    'name'=>config('laravel_doc.languages.project_doc'),
                    'spread'=>true,//菜单是否展开，false不展开
                    'children'=>[
                            'name'=>config('laravel_doc.languages.install'),
                            'doc_link'=>'install.md',
                         ],
                ],
                [
                    'name'=>config('laravel_doc.languages.project_doc'),
                    'spread'=>false,//不展开菜单
                    'children'=>[
                            'name'=>config('laravel_doc.languages.install'),
                            'doc_link'=>'install.md',
                     ],
                ],
            ];
}

```

- after add your menus,add the `doc_link` you add to the `resources/mds/docs` folder

---

api doc
-------

[](#api-doc)

create your md file in the `resources/mds/apidocs`, such as`demo.md`,and add your content then to the`app/Http/Controllers/Docs/LaravelApiDocController.php`,find the method`index_md`to add data，such as：

```
private function index_md()
    {
        return  [
            [
                'name' => 'apidoc_html',
                'doc_link' => 'apidoc_html.md',
                'url' => $this->host.'apidoc/html',
                'request_type' => 'get',
                'params'=>[
                    'name'=>'apidoc_html.md',
                ]
            ],
            [
                'name' => 'demo',
                'doc_link' => 'demo.md',
                'url' => $this->host.'apidoc/html',
                'request_type' => 'get',
                'params'=>[
                    'name'=>'',
                    'user_id'=>'',
                ]
            ],
        ];
    }

```

access to `/doc`

---

`laravel_doc.php`
=================

[](#laravel_docphp)

```
    //laravel-doc name
    'name' => 'Laravel-doc',
    //the author who write the api doc
    'author' => env('DOC_AUTHOR','foryoufeng'),
    //access token
    'token' => env('DOC_TOKEN','doc'),
    'languages'=>[
        'search'=>'搜索',
        'search_result'=>'搜索结果',
        'project_doc'=>'项目文档',
        'doc_name'=>'文档名称',
        'install'=>'安装',
        'how_use'=>'使用说明',
        'request_type'=>'http请求方式',
        'request_url'=>'请求地址',
        'send_request'=>'发送请求',
        'generate_doc'=>'生成文档',
        'welcome_use'=>'欢迎使用',
        'param'=>'参数',
        'value'=>'值',
        'generate'=>'生成',
    ]

```

Advanced
========

[](#advanced)

- Multi-project
    -------------

    [](#multi-project)

to add more project you can copy`app/Http/Controllers/Docs`、`resources/views/docs`,`resources/mds/`and copy routes,then change it

```
//doc route
Route::group(['namespace'=>'Docs'],function (){
    Route::get('doc', 'LaravelDocController@index')->name('doc.index');
    Route::get('doc/html', 'LaravelDocController@html')->name('doc.html');
    Route::get('apidoc', 'LaravelApiDocController@index')->name('doc.apidoc');
    Route::get('apidoc/html', 'LaravelApiDocController@html')->name('doc.apidoc.html');
    Route::post('apidoc/markdown', 'LaravelApiDocController@markdown')->name('doc.apidoc.markdown');
    Route::post('apidoc/save', 'LaravelApiDocController@save')->name('doc.apidoc.save');

});

```

- i18n
    ----

    [](#i18n)

change `languages` value in the`config/laravel_doc.php`to set your own language，Provided by default is`Chinese`

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~206 days

Total

4

Last Release

1934d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b809abc60e2f4e00e3a8797ef6316eabfdd88a8b0282e3971191d9fa7077354?d=identicon)[foryoufeng](/maintainers/foryoufeng)

---

Top Contributors

[![foryoufeng](https://avatars.githubusercontent.com/u/6702914?v=4)](https://github.com/foryoufeng "foryoufeng (7 commits)")

---

Tags

laraveldocapi-docslaravel-doc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/foryoufeng-laravel-doc/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M920](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k36.4M126](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k13.5M60](/packages/knuckleswtf-scribe)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[yakovenko/laravel-lighthouse-graphql-multi-schema

A Laravel package that provides multi-schema support for Lighthouse GraphQL.

17112.5k](/packages/yakovenko-laravel-lighthouse-graphql-multi-schema)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.5k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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