Skip to content

Commit c706b02

Browse files
committed
Filament 4 upgrade
1 parent b4f158c commit c706b02

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"source": "https://github.com/TappNetwork/filament-value-range-filter"
2828
},
2929
"require": {
30-
"php": "^8.1",
31-
"filament/filament": "^3.0-stable"
30+
"php": "^8.2",
31+
"filament/filament": "^4.0"
3232
},
3333
"require-dev": {
3434
"laravel/pint": "^1.14",

src/Filters/ValueRangeFilter.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
namespace Tapp\FilamentValueRangeFilter\Filters;
44

5+
use Filament\Schemas\Components\Fieldset;
6+
use Filament\Forms\Components\Select;
7+
use Filament\Schemas\Components\Utilities\Set;
8+
use Filament\Forms\Components\TextInput;
9+
use Filament\Schemas\Components\Utilities\Get;
10+
use Filament\Schemas\Components\Grid;
511
use Closure;
612
use Filament\Forms;
7-
use Filament\Forms\Get;
8-
use Filament\Forms\Set;
913
use Filament\Tables\Filters\Filter;
1014
use Filament\Tables\Filters\Indicator;
1115
use Illuminate\Database\Eloquent\Builder;
@@ -37,10 +41,10 @@ protected function setUp(): void
3741
parent::setup();
3842

3943
$this
40-
->form(fn () => [
41-
Forms\Components\Fieldset::make($this->getlabel())
44+
->schema(fn () => [
45+
Fieldset::make($this->getlabel())
4246
->schema([
43-
Forms\Components\Select::make('range_condition')
47+
Select::make('range_condition')
4448
->hiddenLabel()
4549
->placeholder(__('filament-value-range-filter::filament-value-range-filter.range.placeholder'))
4650
->live()
@@ -63,47 +67,47 @@ protected function setUp(): void
6367
$set('range_less_than', null);
6468
$set('range_less_than_equal', null);
6569
}),
66-
Forms\Components\TextInput::make('range_equal')
70+
TextInput::make('range_equal')
6771
->hiddenLabel()
6872
->numeric()
6973
->placeholder(fn (): string => $this->getFormattedValue(0))
7074
->visible(fn (Get $get): bool => $get('range_condition') === 'equal' || empty($get('range_condition'))),
71-
Forms\Components\TextInput::make('range_not_equal')
75+
TextInput::make('range_not_equal')
7276
->hiddenLabel()
7377
->numeric()
7478
->placeholder(fn (): string => $this->getFormattedValue(0))
7579
->visible(fn (Get $get): bool => $get('range_condition') === 'not_equal'),
76-
Forms\Components\Grid::make([
80+
Grid::make([
7781
'default' => 1,
7882
'sm' => 2,
7983
])
8084
->schema([
81-
Forms\Components\TextInput::make('range_between_from')
85+
TextInput::make('range_between_from')
8286
->hiddenLabel()
8387
->numeric()
8488
->placeholder(fn (): string => $this->getFormattedValue(0)),
85-
Forms\Components\TextInput::make('range_between_to')
89+
TextInput::make('range_between_to')
8690
->hiddenLabel()
8791
->numeric()
8892
->placeholder(fn (): string => $this->getFormattedValue(0)),
8993
])
9094
->visible(fn (Get $get): bool => $get('range_condition') === 'between'),
91-
Forms\Components\TextInput::make('range_greater_than')
95+
TextInput::make('range_greater_than')
9296
->hiddenLabel()
9397
->numeric()
9498
->placeholder(fn (): string => $this->getFormattedValue(0))
9599
->visible(fn (Get $get): bool => $get('range_condition') === 'greater_than'),
96-
Forms\Components\TextInput::make('range_greater_than_equal')
100+
TextInput::make('range_greater_than_equal')
97101
->hiddenLabel()
98102
->numeric()
99103
->placeholder(fn (): string => $this->getFormattedValue(0))
100104
->visible(fn (Get $get): bool => $get('range_condition') === 'greater_than_equal'),
101-
Forms\Components\TextInput::make('range_less_than')
105+
TextInput::make('range_less_than')
102106
->hiddenLabel()
103107
->numeric()
104108
->placeholder(fn (): string => $this->getFormattedValue(0))
105109
->visible(fn (Get $get): bool => $get('range_condition') === 'less_than'),
106-
Forms\Components\TextInput::make('range_less_than_equal')
110+
TextInput::make('range_less_than_equal')
107111
->hiddenLabel()
108112
->numeric()
109113
->placeholder(fn (): string => $this->getFormattedValue(0))

0 commit comments

Comments
 (0)