PHPackages                             xentral/laravel-docs - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xentral/laravel-docs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xentral/laravel-docs
====================

A laravel package which provides a documentation workflow leveraging phpdocs and mkdocs

0.5.2(2mo ago)023.3k↓23%MITPHPPHP ^8.2CI failing

Since Sep 2Pushed 2mo agoCompare

[ Source](https://github.com/xentral/laravel-docs)[ Packagist](https://packagist.org/packages/xentral/laravel-docs)[ Docs](https://github.com/xentral/laravel-docs)[ RSS](/packages/xentral-laravel-docs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (28)Versions (14)Used By (0)

Laravel Docs
============

[](#laravel-docs)

[![Latest Version on Packagist](https://camo.githubusercontent.com/29dfcdaf4e7a51d2d9a6caac9f755ac54965549db761aaa337db66ede13fab7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78656e7472616c2f6c61726176656c2d646f63732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xentral/laravel-docs)[![Total Downloads](https://camo.githubusercontent.com/b8b93b57144d0e0fff6e7d47aa80bc9f1afb8ea530800a5757b864527eaa3a5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f78656e7472616c2f6c61726176656c2d646f63732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xentral/laravel-docs)[![GitHub Actions](https://github.com/xentral/laravel-docs/actions/workflows/main.yml/badge.svg)](https://github.com/xentral/laravel-docs/actions/workflows/main.yml/badge.svg)

A Laravel package that automatically generates beautiful documentation from your PHPDoc comments using the `@functional` annotation. It extracts functional documentation from your codebase and generates a modern, searchable MkDocs website.

Features
--------

[](#features)

- 🔍 **Automated extraction** of functional documentation from PHPDoc comments
- 📄 **Static content support** for including existing markdown files
- 🏗️ **Hierarchical navigation** with parent-child page relationships
- 🔗 **Smart cross-reference linking** with auto-generated titles and bi-directional discovery
- 📚 **MkDocs integration** with Material Design theme
- 🎯 **Selective documentation** using `@functional` annotation
- 📊 **Dependency tracking** and visualization with Mermaid diagrams
- 📱 **Responsive documentation** with navigation and search
- 🐍 **Python dependencies** managed automatically via uv
- ⚡ **Laravel commands** for easy integration

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

[](#installation)

Install the package via Composer:

```
composer require --dev xentral/laravel-docs
```

The package will automatically register its service provider and commands.

### Prerequisites

[](#prerequisites)

This package requires [uv](https://github.com/astral-sh/uv) to be installed on your system. uv is a fast Python package installer and resolver that's used to manage the MkDocs dependencies.

To install uv:

```
# On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or using pip:
pip install uv

# Or using Homebrew:
brew install uv
```

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

[](#configuration)

Publish the configuration file (optional):

```
php artisan vendor:publish --provider="Xentral\LaravelDocs\DocsServiceProvider"
```

Configure your documentation paths in `config/docs.php`:

```
return [
    'paths' => [
        app_path(), // Include your app directory
        // Add other directories to scan
    ],
    'output' => base_path('docs'),
    'static_content' => [
        'specifications' => [
            'path' => base_path('docs/specifications'),
            'nav_prefix' => 'Specifications',
        ],
        'guides' => [
            'path' => base_path('docs/guides'),
            'nav_prefix' => 'Guides',
        ],
        // Add more static content types as needed
    ],
    'commands' => [
        'build' => 'uvx -w mkdocs-material -w pymdown-extensions mkdocs build',
        'publish' => 'uvx -w mkdocs-material -w pymdown-extensions mkdocs gh-deploy',
        'serve' => 'uvx -w mkdocs-material -w pymdown-extensions mkdocs serve',
    ],
    'config' => [
        'site_name' => 'Your Project Documentation',
        'theme' => ['name' => 'material'],
        // ... additional MkDocs configuration
    ],
];
```

The package uses `uv` (via `uvx`) to automatically manage the Python dependencies (MkDocs and its extensions) without requiring a separate Python environment setup.

Usage
-----

[](#usage)

### Writing Functional Documentation

[](#writing-functional-documentation)

Add the `@functional` annotation to your PHPDoc comments to mark them for extraction:

```
