reedware/nova-textwrap-field
Composer 安装命令:
composer require reedware/nova-textwrap-field
包简介
Adds a text field with wrapping capabilities to Laravel Nova.
README 文档
README
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require reedware/nova-textwrap-field
Usage
Create a new field like you would any other field:
<?php namespace App\Nova; use Reedware\NovaTextwrapField\TextWrap; class MyResource extends TextFilter { /** * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function fields(Request $request, $query, $value) { return [ TextWrap::make('My Field', my_field') ]; } }
Options
The TextWrap field extends the default TextArea field, so any options typically available on TextArea are also availble on TextWrap. Additionally, the TextWrap field is configured to show on the Index page by default (whereas TextArea does not).
There are two additional options:
- Markdown:
TextWrap::make(...)->asMarkdown()will parse and display the contents are markdown - Max Width:
TextWrap::make(...)->withMeta('maxWidth' => '...')will enforce a maximum width on the field content
Apperance
Here's an example of how I've used this in the wild:
统计信息
- 总下载量: 2.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-31
