birdcar / markdown-filament
Filament integration for Birdcar Flavored Markdown
Requires
- php: ^8.2
- birdcar/markdown-laravel: v0.1.0
- filament/filament: ^4.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-05-29 22:54:15 UTC
README
Filament v4 integration for Birdcar Flavored Markdown (BFM).
Provides drop-in replacements for Filament's markdown components that render through the BFM pipeline instead of the default CommonMark config.
Requirements
- PHP 8.2+
- Filament 4.x
birdcar/markdown-laravel(pulled in automatically)
Installation
composer require birdcar/markdown-filament
The service provider is auto-discovered. BFM styles are automatically registered as a Filament asset.
Components
BfmEditor (Form field)
Drop-in replacement for MarkdownEditor with a server-rendered BFM preview.
use Birdcar\Markdown\Filament\Forms\Components\BfmEditor; BfmEditor::make('body') ->previewDebounce(300) // optional, default is 300ms ->columnSpanFull();
The editor adds a Preview/Edit toggle button above the EasyMDE editor. Preview is rendered server-side through Str::bfm() so it matches your actual output exactly.
All standard MarkdownEditor methods work (file attachments, toolbar buttons, min/max height, etc.).
BfmTextColumn (Table column)
Drop-in replacement for TextColumn that renders markdown content as BFM HTML.
use Birdcar\Markdown\Filament\Tables\Columns\BfmTextColumn; BfmTextColumn::make('body');
BfmTextEntry (Infolist entry)
Drop-in replacement for TextEntry that renders markdown content as BFM HTML.
use Birdcar\Markdown\Filament\Infolists\Components\BfmTextEntry; BfmTextEntry::make('body');
Publishable views
php artisan vendor:publish --tag=bfm-filament-views
Publishes the Blade views to resources/views/vendor/bfm-filament/. Only do this if you need to customize the editor markup.
Gotchas
- Filament v4 only. This package uses
callSchemaComponentMethodand#[ExposedLivewireMethod]which are v4 APIs. It will not work with Filament v3. - Preview is server-rendered. Each preview toggle makes a Livewire round-trip. The
previewDebounceoption only applies if you wire up live preview (the default is toggle-based, not live). - BFM styles load automatically. The service provider registers the CSS via
FilamentAsset::register(). You don't need to add@bfmStylesin Filament panels — it's handled for you. BfmTextColumnandBfmTextEntrycall->html()internally. Don't chain->html()again; it's already set up.- The Laravel package must be configured. Render profile and resolvers are controlled by
config/bfm.phpfrom the Laravel package. The Filament package reads from the same converter singleton.
Development
cd packages/filament composer install composer test # Run tests composer analyse # Run PHPStan (level 8)
Tests use Orchestra Testbench with Filament's SchemasServiceProvider. The composer.json includes path repositories pointing to both ../../ (core) and ../laravel (Laravel package) for monorepo resolution.