ferarandrei1 / filament-page-preview
Custom Filament form field that renders a Blade preview
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ferarandrei1/filament-page-preview
Requires
- php: ^8.1|^8.2|^8.3
- filament/filament: ^3.0
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0|^11.0
README
Screenshots
Custom Filament form field that renders a Blade preview.
Installation
Install the package via composer:
composer require ferarandrei1/filament-page-preview
Usage
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(), ]); }
Documentation
- Creating a Preview Route - Step-by-step guide to set up routes and controllers
- Complete Filament Page Example - Full example with two-column layout and live preview
Custom Preview View
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']);
Requirements
- PHP 8.1 or higher
- Filament 3.0 or higher
- Laravel 10.0 or higher
License
MIT License
