Installation
composer require eightynine/filament-docs
php artisan vendor:publish --tag="filament-docs-config" # Optional, for customization
mkdir -p resources/docs
Generate a Documentation Page
php artisan make:filament-docs-page GettingStarted \
--navigation-group="Documentation" \
--navigation-icon="heroicon-o-book-open"
This creates a Filament resource (app/Filament/Resources/DocsPageResource.php) and a corresponding navigation entry.
Add Markdown Content
Create a file at resources/docs/getting-started.md:
# Getting Started
Welcome to your documentation!
Access the Docs Navigate to the Filament admin panel—the new "Documentation" section will appear in the sidebar, linking to your page.
make:filament-docs-page).resources/docs/quick-start.md).quick in the search bar).Content-Driven Development
resources/docs/ with a logical folder structure (e.g., resources/docs/admin/, resources/docs/api/).make:filament-docs-page command to generate Filament resources for each top-level category (e.g., AdminGuide, APIReference).resources/docs/
├── admin/
│ ├── authentication.md
│ └── permissions.md
├── api/
│ └── endpoints.md
└── getting-started.md
Integration with Filament Resources
DocsPageResource to add custom fields or logic. For example, add a published_at field to schedule documentation releases:
// app/Filament/Resources/DocsPageResource.php
public static function form(Form $form): Form
{
return $form
->schema([
// ... existing fields
TextInput::make('published_at')->date(),
]);
}
Search Optimization
// app/Console/Commands/GenerateDocsSearchIndex.php
use Eightynine\FilamentDocs\Facades\Docs;
public function handle()
{
Docs::rebuildSearchIndex();
}
Multi-Language Support
resources/docs/es/, resources/docs/fr/).config/filament-docs.php file to specify default and available locales:
'locales' => [
'en' => 'English',
'es' => 'Español',
'fr' => 'Français',
],
Theming
resources/views/vendor/filament-docs/./* resources/css/filament-docs.css */
.filament-docs .prose {
font-family: 'Inter', sans-serif;
}
Authentication & Permissions
AdminGuide to users with the view-docs permission:
// app/Filament/Resources/DocsPageResource.php
public static function canAccess(): bool
{
return auth()->user()->hasPermissionTo('view-docs');
}
Versioning
version field in the resource to track documentation versions. Example:
# v1.2.0 - 2025-06-24
## Changes
- Added new API endpoints.
public static function table(Table $table): Table
{
return $table
->columns([
// ... other columns
TextColumn::make('version')->searchable(),
]);
}
Embedding Docs in Filament Pages
DocsEmbed component:
use Eightynine\FilamentDocs\Components\DocsEmbed;
public function form(Form $form): Form
{
return $form->schema([
DocsEmbed::make('api_reference')
->path('api/endpoints.md')
->height('400px'),
]);
}
Markdown Parsing Quirks
parse method with custom options:
use Eightynine\FilamentDocs\Facades\Docs;
$content = Docs::parse(file_get_contents('path/to/file.md'), [
'enable_autolink' => true,
'enable_emphasis' => true,
]);
Search Index Lag
// app/Console/Commands/RebuildDocsSearch.php
protected function schedule(Schedule $schedule)
{
$schedule->command(self::class)->nightly();
}
Navigation Group Conflicts
--navigation-group flag.getNavigationGroup() method:
public static function getNavigationGroup(): string
{
return 'Custom Documentation';
}
Dark Mode Inconsistencies
/* resources/css/filament-docs-dark.css */
.filament-docs.dark .prose {
color: #e2e8f0;
}
.filament-docs.dark .prose a {
color: #60a5fa;
}
Markdown Rendering Errors
storage/logs/laravel.log for parsing errors. Enable verbose logging in config/filament-docs.php:
'debug' => [
'markdown' => true,
'search' => true,
],
Search Not Returning Results
php artisan docs:rebuild-search-index
searchable column is included in the resource’s table:
TextColumn::make('content')->searchable()->hidden(),
Artisan Command Failures
--verbose flag for detailed output:
php artisan make:filament-docs-page TestPage --verbose
resources/docs/ directory (create it manually if needed).Custom Markdown Extensions
// app/Providers/FilamentDocsServiceProvider.php
use Eightynine\FilamentDocs\Markdown\DocsMarkdown;
public function boot()
{
DocsMarkdown::extend(function ($parser) {
$parser->addRule('alert', function ($parser) {
// Custom rule for alert blocks
});
});
}
Dynamic Content Loading
use Eightynine\FilamentDocs\Facades\Docs;
$content = Docs::parse($this->getContentFromDatabase());
Custom Search Providers
How can I help you explore Laravel packages today?