Module providers are the core building blocks in Converge. They are the only place where you configure documentation containers, known as modules.
The Official Converge documentation is powered by its own module provider. You can view the full configuration on Github
Each module acts as a fully isolated documentation instance, with its own:
file path (content source),
browser route (endpoint),
theme settings,
view interceptors,
sidebar configuration,
and more.
This architecture enables complete separation and customization of documentation experiences.
Imagine your Laravel application needs to document three different software products. You would create three distinct modules, each with its own ModuleProvider
, allowing you to:
Serve each documentation set from a different URL (/product-a/docs
, /product-b/docs
, ...),
Apply custom themes
per product,
Use different markdown paths
and clusters
,
Add product-specific menus items
, logos
, and settings
.
This modular design makes your docs scalable
, reusable
, and cleanly isolated
.
You can scaffold a new module provider using the following Artisan command:
php artisan converge:make-module DocsModuleProvider
you can omit ModuleProvider suffix
You can configure your module directly from the CLI.
php artisan converge:make-module ConvergeDocs --path="base_path('docs-path')""
Set the browser route:
php artisan converge:make-module ConvergeDocs --path="base_path('docs')" --route="/docs"
Once created, if your folder contains valid Markdown files, you can access your documentation at the route you specified (e.g., /docs
, localhost:8000/docs
, convergephp.test/docs
).
This will generate a ConvergeDocsModuleProvider
and automatically register it in bootstrap/providers.php
.
All module providers are placed under App\Providers\Converge
.
1namespace App\Providers\Converge; 2 3use Converge\Enums\Spotlight; 4use Converge\MenuItems\MenuItem; 5use Converge\MenuItems\MenuItems; 6use Converge\Module; 7use Converge\Providers\ModuleProvider; 8use Converge\Theme\Theme; 9 10class ConvergeDocsModuleProvider extends ModuleProvider 11{ 12 /** 13 * Register New Module Service Provider. 14 */ 15 public function module(Module $module): Module 16 { 17 return $module 18 ->default() 19 ->id('convergedocs') 20 ->routePath('/docs') 21 ->in(base_path('docs')) 22 ->brandLogo("Converge") 23 ->theme(function (Theme $theme) { 24 return $theme 25 ->spotlight(Spotlight::Strock); 26 }) 27 ->defineMenuItems(function (MenuItems $menuItems) { 28 $menuItems->add( 29 fn (MenuItem $menuItem) => 30 $menuItem->url('https://github.com/convergephp') 31 ->openUrlInNewTab() 32 ->label('Github') 33 ); 34 35 $menuItems->add( 36 fn (MenuItem $menuItem) => 37 $menuItem->url('https://github.com/convergephp?sponsor=1') 38 ->label('Sponsor') 39 ); 40 }); 41 } 42}
->default()
: Marks this as the default module. Used internally when no specific module is selected.->id('convergedocs')
: Required. Must be unique across modules. Used to differentiate resources and cache keys.->routePath('/docs')
: URL route for serving the module.->in(base_path('docs'))
: Filesystem path to your documentation.If your docs folder is a symlink, wrap it in realpath() to resolve correctly. 1(eg: realpath(base_path('docs')))
->brandLogo('converge')
(optional): Optional branding logo see branding section for more.
->theme(fn(Converge\Theme\Theme $theme) => ...)
: Configure colors, spotlight behavior, and visual identity see themes docs for more.
->defineMenuItems(fn( Converge\MenuItems\MenuItems $menuItems) => ...)
: Easily define navigation links see menu items docs for more.