PHPackages                             buzekpdev/laravel-docsites - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. buzekpdev/laravel-docsites

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

buzekpdev/laravel-docsites
==========================

Beautiful documentation package for Laravel with dark/light mode, nested navigation, and GitHub Flavored Markdown support

1.0.0(5mo ago)04MITPHPPHP ^8.1|^8.2|^8.3

Since Dec 6Pushed 5mo agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

DocSites - Laravel Documentation Package
========================================

[](#docsites---laravel-documentation-package)

A beautiful, feature-rich documentation package for Laravel applications with dark/light mode support, nested navigation, and live markdown rendering.

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)[![Laravel](https://camo.githubusercontent.com/ccb0953d3a08f2c992ee5bae1cbb03ebd101923f2401346e1b8a551b5197a41f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d7265642e737667)](https://camo.githubusercontent.com/ccb0953d3a08f2c992ee5bae1cbb03ebd101923f2401346e1b8a551b5197a41f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d7265642e737667)

Features
--------

[](#features)

- 🎨 **Beautiful UI** - Clean, modern interface with Tailwind CSS
- 🌓 **Dark/Light Mode** - Automatic theme switching with localStorage persistence
- 📁 **Nested Navigation** - Support for deeply nested documentation structure
- 🔍 **Smart Routing** - Case-insensitive, slugified URLs
- 📝 **GitHub Flavored Markdown** - Full GFM support with syntax highlighting
- ⚡ **React/Inertia** - Smooth SPA experience with Inertia.js
- 🎯 **Index File Support** - Customizable naming and sorting for README/index files
- 🔒 **Environment Control** - Enable/disable based on environment
- 🎨 **Syntax Highlighting** - Beautiful code blocks with highlight.js

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 11.x or 12.x
- Node.js &amp; NPM (for frontend assets)
- Inertia.js with React

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require buzekpdev/laravel-docsites
```

### 2. Publish Configuration

[](#2-publish-configuration)

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

### 3. Publish Assets

[](#3-publish-assets)

```
# Publish React components
php artisan vendor:publish --tag=docsites-views

# Publish CSS files
php artisan vendor:publish --tag=docsites-css
```

### 4. Install NPM Dependencies

[](#4-install-npm-dependencies)

```
npm install react-markdown remark-gfm rehype-highlight rehype-raw highlight.js
```

### 5. Build Assets

[](#5-build-assets)

```
npm run build
# or for development
npm run dev
```

### 6. Create Documentation Directory

[](#6-create-documentation-directory)

Create a `docs/` folder in your project root and add your markdown files:

```
docs/
├── API/
│   ├── authentication.md
│   └── README.md
└── Laravel/
    ├── installation.md
    ├── index.md
    └── Http/
        ├── routing.md
        ├── controllers.md
        └── middleware.md

```

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

[](#configuration)

### PHP Configuration

[](#php-configuration)

Edit `config/docsites.php` to customize your documentation:

```
return [
    // Enable/disable the documentation routes
    'enabled' => env('DOCSITES_ENABLED', true),

    // Environments where docs are available
    'allowed_environments' => ['local', 'staging'],

    // Route prefix (e.g., /docs)
    'route_prefix' => 'docs',

    // Middleware to apply
    'middleware' => ['web'],

    // Documentation directory path
    'docs_path' => base_path('docs'),

    // Index file configuration
    'index_file' => [
        'name' => 'Overview',  // Display name for README.md/index.md
        'sort' => 'prepend',   // 'prepend' or 'append'
    ],
];
```

### JSON Configuration (Optional)

[](#json-configuration-optional)

Create a `docs/docsites.json` file to customize display names and formatting:

```
{
    "$schema": "./docsites.schema.json",
    "alias": {
        "api": "API Reference",
        "Http": "HTTP",
        "user_management": "User Management",
        "README": "Getting Started"
    }
}
```

**Publish example config:**

```
php artisan vendor:publish --tag=docsites-examples
```

**Alias Feature:**

- Define custom display names for files and folders
- Key must match the **exact** file/folder name (case-sensitive)
- Value is the display name shown in the navigation
- **Index files** (README.md, index.md): Alias takes priority over config name

**Name Precedence for Index Files:**

1. JSON alias (if defined in `docsites.json`)
2. Config name (from `config/docsites.php`)
3. Default "Overview"

**Automatic Name Formatting (when not aliased):**

- **snake\_case** files: `user_management.md` → "User Management"
- **camelCase** files: `myDocument.md` → "My Document"
- **ALL\_CAPS** preserved: `user_API_guide.md` → "User API Guide"
- Default: Capitalizes first letter

Usage
-----

[](#usage)

### Basic Documentation Structure

[](#basic-documentation-structure)

1. **Create documentation groups** by creating folders in `docs/`
2. **Add markdown files** with your content
3. **Use nested folders** for organized structure
4. **Add index files** (README.md or index.md) for folder overviews

### Accessing Documentation

[](#accessing-documentation)

Visit `http://your-app.test/docs` to see your documentation.

### File Naming

[](#file-naming)

- Files are automatically slugified for URLs
- `Http Controllers.md` → `/docs/group/http-controllers`
- Case-insensitive matching works seamlessly
- Index files (README.md, index.md) can be customized

### Markdown Features

[](#markdown-features)

Full GitHub Flavored Markdown support:

- Headers (H1-H6)
- Lists (ordered and unordered)
- Code blocks with syntax highlighting
- Tables
- Blockquotes
- Links and images
- Inline code
- Bold and italic text
- Horizontal rules

### Code Syntax Highlighting

[](#code-syntax-highlighting)

Supported languages include PHP, JavaScript, TypeScript, Bash, JSON, YAML, and many more:

```
```php
Route::get('/docs', function () {
    return view('welcome');
});
```
```

### Dark/Light Mode

[](#darklight-mode)

Users can toggle between themes using the button in the top-right corner. Preference is saved in localStorage.

Customization
-------------

[](#customization)

### Theme Colors

[](#theme-colors)

Edit `resources/css/docsites/markdown.css` to customize colors:

```
.markdown-content {
    color: #1f2937; /* Light mode text */
}

.dark .markdown-content {
    color: #e5e7eb; /* Dark mode text */
}
```

### Custom Middleware

[](#custom-middleware)

Add authentication or custom middleware in `config/docsites.php`:

```
'middleware' => ['web', 'auth', 'verified'],
```

### Custom Route Prefix

[](#custom-route-prefix)

Change the route prefix:

```
'route_prefix' => 'documentation',
```

Now accessible at `/documentation` instead of `/docs`.

### Index File Customization

[](#index-file-customization)

Customize how README.md/index.md files appear:

```
'index_file' => [
    'name' => 'Getting Started',  // Custom display name
    'sort' => 'append',            // Show at bottom instead of top
],
```

Production Deployment
---------------------

[](#production-deployment)

### Security Recommendations

[](#security-recommendations)

1. **Restrict environments:**

    ```
    'allowed_environments' => ['local'],
    ```
2. **Add authentication:**

    ```
    'middleware' => ['web', 'auth', 'admin'],
    ```
3. **Use environment variables:**

    ```
    'enabled' => env('DOCSITES_ENABLED', false),
    ```
4. **Disable in production** (if sensitive):

    ```
    DOCSITES_ENABLED=false
    ```

File Structure
--------------

[](#file-structure)

```
lib/docsites/
├── composer.json
├── config/
│   └── docsites.php
├── resources/
│   ├── css/
│   │   └── markdown.css
│   ├── js/
│   │   └── Pages/
│   │       └── DocSites/
│   │           ├── Index.tsx
│   │           └── Show.tsx
│   └── views/
│       └── app.blade.php
├── routes/
│   └── web.php
└── src/
    ├── DocSitesServiceProvider.php
    ├── Http/
    │   └── Controllers/
    │       ├── DocsController.php
    │       └── DocGroupController.php
    └── Services/
        └── DocScanner.php

```

Troubleshooting
---------------

[](#troubleshooting)

### Routes not working

[](#routes-not-working)

1. Check if your environment is allowed:

    ```
    'allowed_environments' => ['local', 'production'],
    ```
2. Clear route cache:

    ```
    php artisan route:clear
    php artisan route:cache
    ```

### Styling issues

[](#styling-issues)

1. Make sure CSS is published:

    ```
    php artisan vendor:publish --tag=docsites-css --force
    ```
2. Rebuild assets:

    ```
    npm run build
    ```

### Markdown not rendering

[](#markdown-not-rendering)

1. Check NPM dependencies are installed:

    ```
    npm install react-markdown remark-gfm rehype-highlight rehype-raw highlight.js
    ```
2. Clear browser cache and rebuild:

    ```
    npm run build
    ```

### Nested routes not working

[](#nested-routes-not-working)

Make sure your web server supports the wildcard routing. For Nginx:

```
try_files $uri $uri/ /index.php?$query_string;
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Credits
-------

[](#credits)

- Built with [Laravel](https://laravel.com)
- UI powered by [Tailwind CSS](https://tailwindcss.com)
- Markdown rendering with [react-markdown](https://github.com/remarkjs/react-markdown)
- Syntax highlighting by [highlight.js](https://highlightjs.org)
- Icons from [Lucide](https://lucide.dev)

Support
-------

[](#support)

For issues, questions, or suggestions, please open an issue on GitHub.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance71

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d00cc76f80ffd816311db0dbe95ab66a9fe03e7903338f14ea9f991cb14b21d?d=identicon)[BuzekPDev](/maintainers/BuzekPDev)

---

Top Contributors

[![BuzekPDev](https://avatars.githubusercontent.com/u/165824760?v=4)](https://github.com/BuzekPDev "BuzekPDev (3 commits)")

---

Tags

laraveldocumentationmarkdowninertiareactdocsdark-modedocsites

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/buzekpdev-laravel-docsites/health.svg)

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

###  Alternatives

[binarytorch/larecipe

Generate gorgeous recipes for your Laravel applications using MarkDown

2.5k2.7M16](/packages/binarytorch-larecipe)[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)[bookdown/themes

Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting

1135.7k1](/packages/bookdown-themes)[grazulex/laravel-atlas

Laravel Atlas scans your Laravel project to generate a complete, structured map of its internal components — models, controllers, routes, jobs, observers, events, commands, and more — and exports visual or machine-readable representations in formats like Mermaid, Markdown, JSON, or PDF.

161.7k](/packages/grazulex-laravel-atlas)

PHPackages © 2026

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