PHP code example of nyoncode / laravel-knowledge-base

1. Go to this page and download the library: Download nyoncode/laravel-knowledge-base library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nyoncode / laravel-knowledge-base example snippets


// config/knowledge-base.php
'editors' => [
    'default' => 'markdown',   // 'tiptap' | 'blocks' | your own
    'drivers' => [
        NyonCode\KnowledgeBase\Editors\MarkdownEditor::class,
        NyonCode\KnowledgeBase\Editors\RichTextEditor::class,
        NyonCode\KnowledgeBase\Editors\BlockEditor::class,
    ],
],

final class NotionLikeEditor implements EditorDriver
{
    public function name(): string { return 'notion'; }
    public function label(): string { return 'Notion-like'; }
    public function format(): ContentFormat { return ContentFormat::Blocks; }
    public function view(): string { return 'editors.notion'; }
    public function isAvailable(): bool { return true; }
}

$this->app->bind(KnowledgeAudience::class, MyTenantAudience::class);
bash
composer vendor:publish --tag=knowledge-base-migrations
php artisan migrate