© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
jeph

Validation didn't work

It's a simple ->gt() validation but I can't seem to make it work.. I can't figure out why. Please help. thanks.

Fieldset::make('Domain Length')
                                ->schema([
                                    TextInput::make('min')
                                        ->numeric()
                                        ->live(),
                                    TextInput::make('max')
                                        ->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
                                        ->numeric()
                                        ->gt('min')
                                        ->live(),
                                ])->columnSpan(2),
Fieldset::make('Domain Length')
                                ->schema([
                                    TextInput::make('min')
                                        ->numeric()
                                        ->live(),
                                    TextInput::make('max')
                                        ->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
                                        ->numeric()
                                        ->gt('min')
                                        ->live(),
                                ])->columnSpan(2),


I also tried custome rules but it still wont work.

TextInput::make('max')
                                        ->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
                                        ->numeric()
                                        ->rules([
                                          function () {
                                              return function (GET $get, $value, Closure $fail) {
                                                  if ($value > $get('min') {
                                                      $fail('The :attribute is invalid.');
                                                  }
                                              };
                                          },
                                      ])
                                        ->live(),
TextInput::make('max')
                                        ->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
                                        ->numeric()
                                        ->rules([
                                          function () {
                                              return function (GET $get, $value, Closure $fail) {
                                                  if ($value > $get('min') {
                                                      $fail('The :attribute is invalid.');
                                                  }
                                              };
                                          },
                                      ])
                                        ->live(),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Export didn't work
FilamentFFilament / ❓┊help
3y ago
Infolist extraAttributes didn't work for tailwindcss
FilamentFFilament / ❓┊help
2y ago
Custom Page Forms Function Didn't Work
FilamentFFilament / ❓┊help
3y ago
Validation does not work
FilamentFFilament / ❓┊help
3y ago