Flatfile model

Under the hood, your markdown files are turned into rows of the FlatfileNode model, powered by sushi. That means every documentation page behaves almost like a regular eloquent model.

Querying

Use the KnowledgeBase facade to get the model class:

use Guava\FilamentKnowledgeBase\Facades\KnowledgeBase;

// Find a specific page
KnowledgeBase::model()::find('knowledge-base.users.introduction');

// Query pages
KnowledgeBase::model()::query()->where('title', 'Some title')->get();
NOTEModel IDs are prefixed with the panel ID of the knowledge base panel they belong to, so the page users/introduction.md of the knowledge-base panel has the ID knowledge-base.users.introduction.

Other facade helpers

// The knowledge base panel (resolved from the current panel)
KnowledgeBase::panel();

// The KnowledgeBasePlugin / KnowledgeBaseCompanionPlugin instance of a panel
KnowledgeBase::plugin();
KnowledgeBase::companion();

// The rendered HTML of a documentation page
KnowledgeBase::markdown('users.introduction');

The knowledge base panel supports filament's global search out of the box, looking through the title and the content of your markdown files.

Custom model

If you need to change the behavior of the model, extend FlatfileNode and point the config to your class:

// config/filament-knowledge-base.php
return [
    'flatfile-model' => App\Models\MyFlatfileNode::class,

    // ...
];
guava/filament-knowledge-base 161K Installationen · 210 Sterne
// COOKIES

Ein paar Cookies halten die Seite am Laufen; andere merken sich Einstellungen oder zählen Besuche. Sie entscheiden.

Cookie-Richtlinie