© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
6 replies
keiron

requiredWithoutAll() doesn't seem to be working

I am attempting to use requiredWithoutAll() on a custom page. This is my condensed code:

<?php

namespace App\Filament\Pages;

use App\Filament\Pages\Concerns\HasProfileSerializationAction;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Page;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Schemas\Schema;
use Livewire\Attributes\Url;

class VetProfile extends Page implements HasSchemas
{
    use InteractsWithSchemas;
    use HasProfileSerializationAction;

    #[Url]
    public ?int $memberId = null;

    protected string $view = 'filament.pages.vet-profile';

    public function form(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('a')
                    ->requiredWithoutAll('b'),
                TextInput::make('b'),
            ]);
    }

    public function save()  {
        // do nothing
    }
}
<?php

namespace App\Filament\Pages;

use App\Filament\Pages\Concerns\HasProfileSerializationAction;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Page;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Schemas\Schema;
use Livewire\Attributes\Url;

class VetProfile extends Page implements HasSchemas
{
    use InteractsWithSchemas;
    use HasProfileSerializationAction;

    #[Url]
    public ?int $memberId = null;

    protected string $view = 'filament.pages.vet-profile';

    public function form(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('a')
                    ->requiredWithoutAll('b'),
                TextInput::make('b'),
            ]);
    }

    public function save()  {
        // do nothing
    }
}


I would have expected that if I don't fill anything in and click Save, I would get an error on TextInput a, as TextInput b has not been filled in. I am actually trying to do this with checkboxes, which also does not work. Am I misunderstanding this or is there a bug?
Solution
The issue I had is that $data = $this->form->getState(); needs to be called in save() for these validation mechanisms to take place.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,330Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Releationship doesn't seem to work in Filter
FilamentFFilament / ❓┊help
3y ago
SelectFilter doesn't working
FilamentFFilament / ❓┊help
17mo ago
`->in()` validation doesn't seem to work with Select
FilamentFFilament / ❓┊help
6mo ago
requiredWithoutAll() validation being ignored
FilamentFFilament / ❓┊help
2y ago