marshmallow/nova-fields-help
Composer 安装命令:
composer require marshmallow/nova-fields-help
包简介
A Laravel Nova help field.
关键字:
README 文档
README
Laravel Nova Help Field
A custom Laravel Nova field which allows you to show custom help messages within form, detail and index screens.
Installation
Install the package via Composer in your Nova project:
composer require marshmallow/nova-fields-help
The field is registered automatically through Laravel package auto-discovery, so there is nothing else to configure.
Usage
Add the field to a resource's fields() method:
use Marshmallow\Nova\Fields\Help\Help; public function fields(Request $request) { return [ Help::make('Help title', 'Help message!'), ]; }
Options
Nova Help Field has many options as follow:
Default templates
Help::make('title', 'message'); // Default help message Help::success('title', 'message'); Help::info('title', 'message'); Help::warning('title', 'message'); Help::danger('title', 'message'); // There's also a special template for headings Help::header('title', 'subtitle'); // If you prefer you can call the non static type method Help::make('title', 'message')->type('warning');
Help templates:
Headings template:
Custom types
You can extend or replace the built-in types and their CSS classes:
// Merge your own types with the built-in ones Help::make('title', 'message') ->addTypes(['brand' => 'bg-brand-light text-brand-dark']) ->type('brand'); // Or replace the full set of types Help::make('title', 'message') ->types(['brand' => 'bg-brand-light text-brand-dark']) ->type('brand');
Both title and message are optional
Help::make('Only title'); Help::make()->message('Only message');
Messages can also be callable
Help::make()->message(function () { return "{$this->name} is awesome!"; });
Icons
You can pick one of the default SVG icons (http://www.zondicons.com/) provided by Steve Schoger.
Help::make('Title')->icon('help'); // the default one Help::make('Title')->icon('info'); Help::make('Title')->icon('warning'); Help::make('Title')->icon('danger'); // Load a custom one Help::make('Love you') ->message('Yes, I love you!') ->icon('<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m10 3.22-.61-.6a5.5 5.5 0 0 0 -7.78 7.77l8.39 8.39 8.39-8.4a5.5 5.5 0 0 0 -7.78-7.77z"/></svg>'); // or show no icon at all Help::make('Sad')->withoutIcon();
Render html messages
Help::make('Title', 'Message with <a href="#">link</a>')->displayAsHtml();
From v0.2 the displayAsHtml() method applies also to the field name (unless shown as column header on index).
Full width on details screen
// Remove annoing padding in detail screen, also the default behaviour for the heading template Help::make('Negative margin')->showFullWidthOnDetail();
With side label
// Show a side label instead of the title on the top Help::make('Look I\'m on the side') ->message('I\'m not...') ->withSideLabel();
Collapsible help fields
Help fields can be made collapsible using the fluent method collapsible().
Collapsible help fields are collapsed by default and toggle their state clicking on their title.
Also, keep in mind that collapsible fields must define both a title and message and cannot be used with side labels.
// Collapsible field Help::info('Click here to toggle', 'Lorem ipsum dolor sit amet...') ->collapsible();
Show help messages on index
/** * By default help messages aren't shown on index, * when enabled they are shown as an hoverable * icon showing a plain (no html) tooltip. */ Help::make('Column title') ->message('Message with <a href="#">link</a>') // The link code will be stripped out on index ->alsoOnIndex(); // Field icons can be shown conditionally on index Help::make()->message(function () { return $this->name ? "{$this->name} is awesome!" : null; })->onlyOnIndex();
Changelog
Please see changelog.md for more information on what has changed recently.
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see the License File for more information.
marshmallow/nova-fields-help 适用场景与选型建议
marshmallow/nova-fields-help 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.3k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2020 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「help」 「nova」 「laravel」 「marshmallow」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 marshmallow/nova-fields-help 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marshmallow/nova-fields-help 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 marshmallow/nova-fields-help 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
Frequently Asked Questions (FAQ) plugin. With categories, on-the-fly search, customer helpfulness tracking and comments.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A wrapper for silverstripe/docsviewer that pulls the documentation into the CMS adding a Site Help option to the help menu.
统计信息
- 总下载量: 16.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 18
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-09








