norman-huth/nova-bbcode-textarea

Laravel Nova 的 BBCodes 文本区域和文本字段

资助包维护!
huth.it/coffee

安装次数: 7,147

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 1

开放问题: 0

语言:JavaScript

0.0.3 2022-07-02 10:28 UTC

This package is auto-updated.

Last update: 2024-09-24 21:05:40 UTC


README

快速开发。简短教程。

使用此 Nova 字段,您将拥有带有 BBCodes 的 文本区域文本 字段。

(已测试 Nova 4)

安装

composer require norman-huth/nova-bbcode-textarea

使用

use NormanHuth\BBCode\BBCode;

BBCode::make(__('Name'), 'name')->codes([
    '{author}' => __('This code insert the author'),
    '{date}' => __('This code insert the date'),
]),

或文本字段

use NormanHuth\BBCode\BB;

BB::make(__('Name'), 'name')->codes([
    '{author}' => __('This code insert the author'),
    '{date}' => __('This code insert the date'),
]),

不总是在 Nova 中显示文本区域字段的内容

BBCode::make(__('Name'), 'name')->codes([
    '{author}' => __('This code insert the author'),
    '{date}' => __('This code insert the date'),
])->alwaysShow(false),

更改按钮类

BBCode::make(__('Name'), 'name')->codes([
    '{author}' => __('This code insert the author'),
    '{date}' => __('This code insert the date'),
])->btnClass('px-2 bg-white-200 text-dark-800'),

向按钮添加内联样式

BBCode::make(__('Name'), 'name')->codes([
    '{author}' => __('This code insert the author'),
    '{date}' => __('This code insert the date'),
])->btnStyle('margin-bottom: 1rem'),

Stand With Ukraine Woman. Life. Freedom.