PHP code example of edeoliv / filament-datefilter

1. Go to this page and download the library: Download edeoliv/filament-datefilter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

edeoliv / filament-datefilter example snippets


use Edeoliv\FilamentDateFilter\DateFilter;

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

use Edeoliv\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'))

use Edeoliv\FilamentDateFilter\DateFilter;

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

use Edeoliv\FilamentDateFilter\DateFilter;

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