arsenaltech/nova-header

Laravel Nova 字段。

dev-master 2018-11-06 17:45 UTC

This package is auto-updated.

Last update: 2024-09-07 06:48:06 UTC


README

自定义 Nova 字段,用于在使用选项卡时添加字段标题 https://github.com/arsenaltech/nova-tab

安装

使用 Composer 将包安装到使用 Nova 的 Laravel 应用程序中

composer require arsenaltech/nova-header

用法

在资源中的 fields 方法中添加字段

new NovaTab('User Information', [
            NovaHeader::make('Example Title'),
            Text::make('Name')
                ->sortable()
                ->rules('required', 'max:255'),
            Text::make('Email')
                ->sortable()
                ->rules('required', 'email', 'max:255')
                ->creationRules('unique:users,email')
                ->updateRules('unique:users,email,{{resourceId}}')]),
new NovaTab('Address Information', $this->addressFields()),
new NovaTab('Other Information', $this->otherFields()),