定制 community-sdks/unlayer-filament 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

community-sdks/unlayer-filament

Composer 安装命令:

composer require community-sdks/unlayer-filament

包简介

Filament wrapper for unlayer editor.

README 文档

README

UnlayerFilament
  • This is a Filament field wrapper for the Unlayer editor. It delegates the editor runtime to community-sdks/unlayer-livewire, which wraps the Alpine and TypeScript SDK packages.

Try The Example

If you want to try the package quickly in a Laravel app, install it and then install the bundled quick demo:

This package ships its example through zpmlabs/laravel-package-quick-demo. The quick demo installer sets up an isolated demo environment for the package so you can try the field without manually wiring routes, database connections, migrations, seeders, or demo views into your main application.

composer require community-sdks/unlayer-filament
php artisan quick-demo:install unlayer-filament-demo

To inspect the registered demo or see its route details:

php artisan quick-demo:show unlayer-filament-demo

The bundled Unlayer Filament Demo includes an email editor tab and a web/page editor tab, both backed by isolated quick-demo data.

Requirements

  • PHP 8.3+
  • Laravel 13+
  • Filament 5.x

Installation

You can install the package via composer:

composer require community-sdks/unlayer-filament

Install The Livewire Browser Asset

The Filament field depends on the browser asset published by community-sdks/unlayer-livewire.

Install it with:

php artisan unlayer-livewire:install

This publishes the compiled browser file to:

public/unlayer-livewire.js

After upgrading the Livewire package or rebuilding that browser asset locally, publish the latest file again:

php artisan vendor:publish --tag=unlayer-livewire-assets --force

If you also want to publish the Livewire config to customize upload storage or other package options:

php artisan unlayer-livewire:install --config

To overwrite previously published files during install:

php artisan unlayer-livewire:install --force

You can also publish assets or config manually:

php artisan vendor:publish --tag=unlayer-livewire-assets --force
php artisan vendor:publish --tag=unlayer-livewire-config

Version Compatibility

This package targets Filament 5.x only.

  • Filament 5.x: use this package line, composer require community-sdks/unlayer-filament

Create a cast within your model:

protected $casts = [
   'content' => 'array',
];

The field stores the editor state as an array containing both html and design.

If you want to customize uploads or the template proxy route prefix, publish the Livewire package config:

php artisan vendor:publish --tag="unlayer-livewire-config"

Optionally, you can publish the views using

php artisan vendor:publish --tag="unlayer-filament-views"

Usage

As any other filament form field:

Unlayer::make('content')->required()

In case you want users to choose Unlayer stock templates from inside the editor, enable the template picker:

Unlayer::make('content')
    ->required()
    ->templatePicker()

The picker loads templates through the Livewire package's same-origin backend proxy and applies the selected design directly to the initialized editor.

You can customize the default stock template query:

Unlayer::make('content')
    ->templatePicker(options: [
        'type' => 'email', // or 'web'
        'premium' => false,
        'limit' => 20,
        'offset' => 0,
        'collection' => '',
        'sort' => 'recent',
    ])

You can customize the picker toolbar and panel labels:

Unlayer::make('content')
    ->templatePicker()
    ->templatePickerOptions([
        'label' => 'Template Editor',
        'triggerLabel' => 'Search templates',
        'title' => 'Templates',
        'placeholder' => 'Search templates',
        'emptyText' => 'No templates found.',
    ])

Live syncing is disabled by default. If you want every editor change to sync immediately through Livewire, enable it explicitly:

Unlayer::make('content')
    ->syncLive()

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'
    ])

The built-in Livewire proxy exists because Unlayer's stock template endpoints do not allow direct browser CORS requests. Behind the proxy, template search calls:

POST https://unlayer.com/templates/search
Content-Type: application/json

The field's templatePicker(options: [...]) values map to the upstream request body like this:

search     -> filter.name
type       -> filter.type
premium    -> filter.premium, "true" when true, "" when false
limit      -> perPage
offset     -> page, calculated as floor(offset / limit) + 1
collection -> filter.collection
sort       -> filter.sortBy

Selected templates are loaded through:

POST https://studio.unlayer.com/api/v1/graphql

The Livewire package also supports overriding its route prefix and middleware in config/unlayer-livewire.php.

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.

community-sdks/unlayer-filament 适用场景与选型建议

community-sdks/unlayer-filament 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「Community SDKs」 「unlayer-filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 community-sdks/unlayer-filament 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 community-sdks/unlayer-filament 我们能提供哪些服务?
定制开发 / 二次开发

基于 community-sdks/unlayer-filament 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 38
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-02