Unlayer
Wrapper for unlayer editor with unlayer templates custom select field.
Author:
InfinityXTech
Documentation
This is a filament wrapper for unlayer editor with custom select field with unlayer templates.
#Installation
You can install the package via composer:
composer require InfinityXTech/filament-unlayer
Create a cast within your model:
protected $casts = [
'content' => 'array',
];
You can publish the config file with:
php artisan vendor:publish --tag="filament-unlayer-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-unlayer-views"
#Usage
As any other filament form field:
Unlayer::make('content')->required()
In case you want to select unlayer templates you can use:
SelectTemplate::make('template'),
Unlayer::make('content')->required()
By default the Unlayer field name should content but if you need to change it you will need to update SelectTemplate:
SelectTemplate::make('template')
->afterStateUpdated(fn (string $operation, $state, Forms\Set $set)
=> $set('description', InfinityXTech\FilamentUnlayer\Services\GetTemplates::find($state))
),
Unlayer::make('description')->required()
If you want to pass additional options to unlayer, which will join default object set by plugin with your additional data you can use:
Unlayer::make('description')
->additionalOptions([
'option' => 'value'
])
You can still chain other methods on these since:
SelectTemplate is extending filament Select field.
Unlayer is extending filament Field class.
#Changelog
Please see CHANGELOG for more information on what has changed recently.
#License
The MIT License (MIT). Please see License File for more information.
The author
From the same author
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese