codicastudio/field-agent

一个随机的Codica Studio包。

1.0.0 2020-09-25 01:53 UTC

This package is auto-updated.

Last update: 2024-09-25 13:30:05 UTC


README

描述

这个字段可以隐藏在移动屏幕上的资源表字段,以实现更好的响应式概念。

截图

Screenshot

安装

该包可以通过Composer安装。

composer require outhebox/nova-fields-agent

示例用法

注意:所有字段均受支持(例如仅支持“文本字段”)。

// Important !!!
use Outhebox\NovaFieldsAgent\HasNovaFieldsAgent;

class Example extends Resource
{
    use HasNovaFieldsAgent; // Important !!!

    /**
     * Get the fields displayed by the resource.
     *
     * @param  \Illuminate\Http\Request  $requestµµ
     * @return array
     */
    public function fields(Request $request)
    {
        Text::make('ExampleField')
            ->hideFromDetailOnMobile() // Hide the field from details page on Mobile
            ->hideFromDetailOnTablet() // Hide the field from details page on Tablet
            ->HideFromIndexOnMobile() // Hide the field from index on Mobile
            ->HideFromIndexOnTablet() // Hide the field from index on Tablet
            ->sortable(),
    }
}