vlotysh / filament-docs
Documentation system for Filament with TipTap editor, hierarchical pages, wiki-links, and static HTML export
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/vlotysh/filament-docs
Requires
- php: ^8.2
- awcodes/filament-tiptap-editor: ^3.0
- filament/filament: ^3.0
- spatie/laravel-activitylog: ^4.0
- spatie/laravel-translatable: ^6.0
README
Documentation system for Laravel Filament with TipTap editor, hierarchical pages, wiki-links, and export to HTML/PDF.
Features
- TipTap WYSIWYG Editor - rich text editing with media uploads
- Hierarchical Pages - unlimited nesting with drag & drop reordering
- Wiki-Links - Obsidian-style cross-references
[[slug]]or[[slug|Display Text]] - Backlinks - automatic tracking of pages that link to current page
- Full-Text Search - Meilisearch integration via Laravel Scout
- Privacy Modes - public / admin-only / password-protected
- Multilingual - Spatie Translatable support (uk/en or any locales)
- Export to HTML - static site with offline images (base64)
- Export to PDF - single file with table of contents
Requirements
- PHP 8.1+
- Laravel 10+
- Filament 3.x
- FilamentTiptapEditor
Installation
composer require vlotysh/filament-docs
Publish config and migrations:
php artisan vendor:publish --tag=filament-docs-config php artisan vendor:publish --tag=filament-docs-migrations php artisan migrate
Register the plugin in your Filament panel:
// app/Providers/Filament/AdminPanelProvider.php use Vlotysh\FilamentDocs\FilamentDocsPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ FilamentDocsPlugin::make(), ]); }
Configuration
Config file: config/filament-docs.php
return [ // Visibility: 'public', 'admin', or 'password' 'default_visibility' => env('DOCS_VISIBILITY', 'admin'), // Route prefixes 'route_prefix' => 'docs', 'api_prefix' => 'api/docs', // Middleware 'admin_middleware' => ['web', 'auth', 'admin'], 'public_middleware' => ['web'], // Features 'features' => [ 'search' => true, 'export' => true, 'wiki_links' => true, ], // Media storage disk 'media_disk' => env('DOCS_MEDIA_DISK', 'public'), // Custom admin check (optional) 'admin_check' => null, // fn($user) => $user->hasRole('admin'), ];
Visibility Modes
| Mode | Description |
|---|---|
public |
Anyone can view docs |
admin |
Only authenticated admins |
password |
Password protected (set in admin panel) |
API Endpoints
GET /api/docs - Navigation tree
GET /api/docs/pages - All pages list
GET /api/docs/{slug} - Page content with prev/next
GET /api/docs/search?q= - Search pages
POST /api/docs/verify-password - Verify password (for password mode)
Wiki-Links
Use Obsidian-style syntax in content:
[[getting-started]] → Links to page with slug "getting-started"
[[getting-started|Get Started]] → Links with custom display text
[[admin/users]] → Links to nested page
Broken links are highlighted in red. Backlinks appear at the bottom of each page.
Export
From the admin panel (Doc Pages list):
- Export to HTML - Downloads ZIP with static HTML files, inline CSS, and base64 images
- Export to PDF - Downloads single PDF with cover page and table of contents
Frontend Integration
Example React integration:
// API service export const docsAPI = { getNavigation: () => api.get('/api/docs'), getPage: (slug) => api.get(`/api/docs/${slug}`), search: (query) => api.get('/api/docs/search', { params: { q: query } }), }; // Usage const { data } = await docsAPI.getPage('getting-started'); // data: { title, content, breadcrumb, children, prev, next, backlinks }
Search Setup (Optional)
For full-text search, configure Laravel Scout with Meilisearch:
composer require meilisearch/meilisearch-php
SCOUT_DRIVER=meilisearch MEILISEARCH_HOST=http://localhost:7700 MEILISEARCH_KEY=your-master-key
php artisan scout:import "Vlotysh\FilamentDocs\Models\DocPage"
License
MIT