Custom Filament form field that renders a Blade preview.

Install the package via composer:
composer require ferarandrei1/filament-page-preview
Use the PreviewField component in your Filament form:
use Feraandrei1\FilamentPagePreview\Forms\Components\PreviewField;use Filament\Forms\Form;Â public function form(Form $form): Form{ return $form->schema([ PreviewField::make('preview_field') ->previewData([ 'user' => Auth::user()->username, 'previewRouteName' => 'preview', 'data' => $data, ]) ->nullable(), ]);}
You can publish the views to customize them:
php artisan vendor:publish --tag=filament-page-preview-views
Or, you can specify a custom view for the preview:
PreviewField::make('preview_field') ->previewView('filament.view-fields.custom-preview') ->previewData(['key' => 'value']);
MIT License