treestoneit/html
最新稳定版本:v1.0
Composer 安装命令:
composer require treestoneit/html
包简介
A Laravel Nova Html View field.
README 文档
README
Since Nova now includes asHtml() Meta on the Text field (as of v1.0.9), there is no more need for this package as same functionality can be achieved with core Text field.
This field allows you display custom HTML in Laravel Nova, be it a link, an image or any other piece of proper html.
Installation
Install the package into a Laravel app that uses Nova with Composer:
composer require treestoneit/html
Usage
Add the field to your resource in the fields method:
use Treestoneit\Html\Html; ... ... Html::make('Track',function (){ $link = "<a class='text-70' target='_blank' href='$this->tracking_link'>"; $link .= "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"18\" class='fill-current' viewBox=\"0 0 20 20\"><path d=\"M9.26 13a2 2 0 0 1 .01-2.01A3 3 0 0 0 9 5H5a3 3 0 0 0 0 6h.08a6.06 6.06 0 0 0 0 2H5A5 5 0 0 1 5 3h4a5 5 0 0 1 .26 10zm1.48-6a2 2 0 0 1-.01 2.01A3 3 0 0 0 11 15h4a3 3 0 0 0 0-6h-.08a6.06 6.06 0 0 0 0-2H15a5 5 0 0 1 0 10h-4a5 5 0 0 1-.26-10z\"/></svg>"; $link .= "</a>"; return $link; })
If you have proper html saved in the database or cast by your model to HTML
use Treestoneit\Html\Html; ... ... Html::make('Your Field Label','your_field')
Please note: Only Index and Detail version of the field is configured
统计信息
- 总下载量: 20.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-31