keops007/nova-big-filter-with-reset

一个看起来很不错的始终开启的过滤器菜单。

v1.0 2020-05-19 09:52 UTC

This package is auto-updated.

Last update: 2024-09-19 19:22:58 UTC


README

Latest Version on Github Total Downloads

扩展自 https://github.com/nrml-co/nova-big-filter

安装

通过composer在Laravel Nova项目中安装此包

composer require keops007/nova-big-filter-with-reset 

用法

将类添加到具有过滤器的资源卡片数组中。默认的“每页”过滤器不包括在内。如果您添加了卡片但没有过滤器,将看不到任何内容。添加一些过滤器,它就会出现。

此包通过消除默认过滤器的繁琐点击和滚动,使生活变得简单。您可能需要调整过滤器的顺序以获得最佳外观。例如,日期过滤器在底部看起来最好。

use Keops007\NovaBigFilterWithReset\NovaBigFilter;
use App\Nova\Filters\YourFilter;
use App\Nova\Filters\YourOtherFilter;

public function filters()
{
    return [
        new YourFilter,
        new YourOtherFilter,
    ];
}

public function cards()
{
    return [        
        new NovaBigFilter,
    ];
}

自定义

根据需要添加自定义函数,并按要求进行。 :)

setTitle($title)

使用setTitle更改卡片标题。默认为'过滤器菜单'。

public function cards()
{
    return [        
        (new NovaBigFilter)->setTitle('Big Filter'),
    ];
}

setMaxHeight($height)

使用setMaxHeight更改过滤器块的最大高度。默认为350。

public function cards()
{
    return [        
        (new NovaBigFilter)->setMaxHeight(400),
    ];
}

hideFilterTitle()

使用hideFilterTitle隐藏过滤器块的标题,如果您不需要它。

public function cards()
{
    return [        
        (new NovaBigFilter)->hideFilterTitle(),
    ];
}

致谢:https://github.com/nrml-co/nova-big-filter