norman-huth / nova-bbcode-textarea
Laravel Nova 的 BBCodes 文本区域和文本字段
0.0.3
2022-07-02 10:28 UTC
Requires
- php: ^8.0
- laravel/nova: ^4.0.0
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'),