定制 webbingbrasil/filament-datefilter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

webbingbrasil/filament-datefilter

最新稳定版本:1.1.1

Composer 安装命令:

composer require webbingbrasil/filament-datefilter

包简介

Date filter component for filament tables.

README 文档

README

A easy-to-use date filter with range option for Laravel Filament.

Installation

Install the package via composer (requires filament >= 2.15)

composer require webbingbrasil/filament-datefilter

Usage

Date filters allow you to quickly create a filter that allows the user to select a date.

use Webbingbrasil\FilamentDateFilter\DateFilter;

DateFilter::make('created_at')
    ->label(__('Created At'))
    ->minDate(Carbon::today()->subMonth(1))
    ->maxDate(Carbon::today()->addMonth(1))
    ->timeZone('America/New_York')

Another common use case is to filter by a date range. You can do this with range() method:

use Webbingbrasil\FilamentDateFilter\DateFilter;

DateFilter::make('created_at')
    ->label(__('Created At'))
    ->minDate(Carbon::today()->subMonth(1))
    ->maxDate(Carbon::today()->addMonth(1))
    ->timeZone('America/New_York')
    ->range()
    ->fromLabel(__('From'))
    ->untilLabel(__('Until'))

If you need to use a different column name than the one you pass to the make() method, you can use the useColumn() method:

use Webbingbrasil\FilamentDateFilter\DateFilter;

DateFilter::make('created_at')
    ->useColumn('updated_at')

Global Configuration

You can set From/Until label globally using configureUsing() method in a service provider:

use Webbingbrasil\FilamentDateFilter\DateFilter;

DateFilter::configureUsing(fn ($filter) => $filter->fromLabel(__('From'))->untilLabel(__('Until')));

Credits

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-06