Docs
A Filament plugin for creating elegant documentation pages within your admin panel.
Author:
Eighty Nine
Documentation
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- Advanced Usage
- Commands
- Customization
- License
A Filament plugin for creating elegant documentation pages within your admin panel.
#Features
- Markdown Support: Full CommonMark compatibility with syntax highlighting
- Real-time Search: Instant search with context-aware results
- Responsive Design: Mobile-first with dark mode support
- Multi-language: Built-in internationalization support
- Theme Integration: Seamlessly integrates with Filament themes
- Artisan Commands: CLI tools for generating pages and content
#Requirements
- PHP 8.1+
- Laravel 10.0+
- Filament 3.0+
#Installation
composer require eightynine/filament-docs
Publish configuration (optional):
php artisan vendor:publish --tag="filament-docs-config"
Create documentation directory:
mkdir -p resources/docs
#Quick Start
- Create a documentation page:
php artisan make:filament-docs-page UserManual \
--navigation-group="Documentation" \
--navigation-icon="heroicon-o-book-open"
- Add markdown files to
resources/docs/:
# Getting Started
Welcome to the documentation!
- Access your documentation in the Filament admin panel.
#Configuration
The configuration file config/filament-docs.php allows customization:
return [
'default_docs_path' => resource_path('docs'),
'search' => [
'debounce_ms' => 300,
],
'ui' => [
'sidebar_width' => 'lg:w-80',
'default_navigation_group' => 'Documentation',
],
];
#Advanced Usage
#Custom Documentation Page
<?php
namespace App\Filament\Pages;
use EightyNine\FilamentDocs\Pages\DocsPage;
class UserManual extends DocsPage
{
protected static ?string $navigationIcon = 'heroicon-o-book-open';
protected static ?string $navigationGroup = 'Documentation';
protected static ?string $title = 'User Manual';
protected function getDocsPath(): string
{
return resource_path('user-manual');
}
protected function getSectionOrder(string $filename): int
{
return match($filename) {
'introduction' => 1,
'installation' => 2,
'usage' => 3,
default => 99,
};
}
}
#Multi-language Support
// config/filament-docs.php
return [
'localization' => [
'supported_locales' => ['en', 'es', 'fr'],
'locale_paths' => [
'en' => 'docs/en',
'es' => 'docs/es',
'fr' => 'docs/fr',
],
],
];
Directory structure:
resources/docs/
├── en/
│ ├── getting-started.md
│ └── user-guide.md
├── es/
│ ├── getting-started.md
│ └── user-guide.md
└── fr/
├── getting-started.md
└── user-guide.md
#Commands
#Create Documentation Page
# Basic page
php artisan make:filament-docs-page MyDocs
# With options
php artisan make:filament-docs-page ApiDocs \
--navigation-group="Developer" \
--navigation-icon="heroicon-o-code-bracket" \
--title="API Documentation" \
--slug="api-docs"
#Create Markdown Content
# Basic markdown file
php artisan make:filament-docs-markdown "Getting Started"
# With template
php artisan make:filament-docs-markdown "API Guide" --template=api
Available templates: basic, guide, api, troubleshooting, feature
#Customization
#Custom Views
Publish views for customization:
php artisan vendor:publish --tag="filament-docs-views"
#Custom Styling
Publish assets:
php artisan vendor:publish --tag="filament-docs-assets"
Add custom CSS:
.docs-container {
@apply max-w-7xl mx-auto;
}
.docs-sidebar {
@apply w-64 bg-white dark:bg-gray-900;
}
#Performance Optimization
Enable caching for large documentation:
class CachedDocsPage extends DocsPage
{
protected function getCachedContent(string $filename): string
{
return Cache::remember(
"docs.content.{$filename}",
3600,
fn() => $this->loadAndProcessMarkdown($filename)
);
}
}
#License
MIT License. See LICENSE.md for details.
The author
Eighty Nine is a software developer who loves to create plugins and packages for the Laravel ecosystem. He is passionate about sharing his knowledge and experience with other developers through medium and social media. He believes in pouring all the love and effort in his work.
From the same author
Approvals
This package allows you to easily implement approval flows in your Laravel Filament application.
Author:
Eighty Nine
Excel Import
This package adds a new action to your filament resource table, allowing you to easily import data to your model from excel files.
Author:
Eighty Nine
Page Alerts
This package allows you to easily add alerts to your application's pages.
Author:
Eighty Nine
Reports
This package allows you to easily generate elegant reports in your application.
Author:
Eighty Nine