定制 infinityxtech/filament-unlayer 二次开发

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

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

infinityxtech/filament-unlayer

最新稳定版本:v1.0.4

Composer 安装命令:

composer require infinityxtech/filament-unlayer

包简介

Filament wrapper for unlayer editor.

README 文档

README

image

Latest Version on Packagist GitHub Tests Action Status Total Downloads

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.

统计信息

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

GitHub 信息

  • Stars: 28
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-23