承接 digital-creative/nova-mega-filter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digital-creative/nova-mega-filter

最新稳定版本:v1.0.5

Composer 安装命令:

composer require digital-creative/nova-mega-filter

包简介

Allows you to control the columns and filters shown on your nova resources.

README 文档

README

Latest Version on Packagist Total Downloads License

Display all your filters in a card instead of a tiny dropdown!

Nova Mega Filter in Action

Installation

You can install the package via composer:

composer require digital-creative/nova-mega-filter

Basic Usage

Basic demo showing the power of this package:

use DigitalCreative\MegaFilter\MegaFilter;
use DigitalCreative\MegaFilter\MegaFilterTrait;

class ExampleNovaResource extends Resource {

    use MegaFilterTrait;

    public function filters(RequestRequest $request): array
    {
        return [
            MegaFilter::make([
                DateOfBirthFilter::make(),
                UserTypeFilter::make(),
            ]),
        ];
    }

}

And you are done!

Previously this package also had the ability to toggle columns, but since the nova 4 upgrade this functionality has been moved away to its own package: https://github.com/dcasia/column-toggler

You can also add other fields alongside your Mega Filters, they will be rendered as usual:

use DigitalCreative\MegaFilter\MegaFilter;
use DigitalCreative\MegaFilter\MegaFilterTrait;

class ExampleNovaResource extends Resource {

    use MegaFilterTrait;

    public function filters(NovaRequest $request): array
    {
        return [
            MegaFilter::make([ ... ]),
            
            // These will be rendered as normal on the usual tiny filter dropdown
            DateOfBirthFilter::make(),
            UserTypeFilter::make(),
        ];
    }

}

You can also set how many columns you want to display your filters:

public function filters(NovaRequest $request): array
{
    return [
        MegaFilter::make([ ... ])->columns(3),
    ];
}

By default, the filter section is collapsed. If you want it to open or expanded initially, you can do:

public function filters(NovaRequest $request): array
{
    return [
        MegaFilter::make([ ... ])->open(),
    ];
}

Note: At the moment this package only works with a single Mega Filter per resource, adding multiple on the same resource may result in unexpected behavior.

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

Other Packages You Might Like

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 147.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 87
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 87
  • Watchers: 8
  • Forks: 21
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-23