© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
5 replies
Tieme

Disable validation (when save as concept)

Hi all,

I have a multi step form (4 steps total)
I want to disable all validation on step 2,3,4 if user presses the "Save as concept" action.

Below is my Action
private function getCreateConceptFormAction(): Action
{
    return Action::make('concept')
        ->label(Helpers::translate('Save as concept'))
        ->color('info')
        ->submit(null)
        ->action(function ($livewire) {
            $livewire->data['status'] = CarStatus::CONCEPT;
            $this->create();
        })
        ->keyBindings(['mod+s']);
}
private function getCreateConceptFormAction(): Action
{
    return Action::make('concept')
        ->label(Helpers::translate('Save as concept'))
        ->color('info')
        ->submit(null)
        ->action(function ($livewire) {
            $livewire->data['status'] = CarStatus::CONCEPT;
            $this->create();
        })
        ->keyBindings(['mod+s']);
}


As you can see i set a 'status' attribute. but the create process is the same as normal.

I know the validation is somewhere in the below function and i think i need to overwrite this function to check the 'status' if i need to validate

$this->form->getState();
$this->form->getState();


i think i am overthinking this, so any help/insight would be helpful.

Thanks.
Solution
i solved it like this.

create a function in the resource
private static function requiredConcept(): \Closure
{
    return fn ($livewire) => ! array_key_exists('status', $livewire->data) || $livewire->data['status'] != CarStatus::CONCEPT;
}
private static function requiredConcept(): \Closure
{
    return fn ($livewire) => ! array_key_exists('status', $livewire->data) || $livewire->data['status'] != CarStatus::CONCEPT;
}


and call this function in required
Forms\Components\TextInput::make('price')
    ->prefixIcon('heroicon-o-currency-euro')
    ->formatStateUsing(fn ($state) => str_replace('.', ',', $state))
    ->mask(Support\RawJs::make('$money($input, \',\', \' \', 2)'))
    ->stripCharacters(' ')
    ->dehydrateStateUsing(fn ($state) => str_replace(',', '.', $state))
    ->columnSpan([
        'default' => 1,
    ])
    ->required(self::requiredConcept()),
Forms\Components\TextInput::make('price')
    ->prefixIcon('heroicon-o-currency-euro')
    ->formatStateUsing(fn ($state) => str_replace('.', ',', $state))
    ->mask(Support\RawJs::make('$money($input, \',\', \' \', 2)'))
    ->stripCharacters(' ')
    ->dehydrateStateUsing(fn ($state) => str_replace(',', '.', $state))
    ->columnSpan([
        'default' => 1,
    ])
    ->required(self::requiredConcept()),


and change the create action
$this->getCreateFormAction()
    ->label(Helpers::translate('Create Subscription'))
    ->keyBindings(false)
    ->color('success')
    ->submit(null)
    ->action(function ($livewire) {
        $livewire->data['status'] = CarStatus::PENDING;
        $this->create();
    })
    ->requiresConfirmation()
$this->getCreateFormAction()
    ->label(Helpers::translate('Create Subscription'))
    ->keyBindings(false)
    ->color('success')
    ->submit(null)
    ->action(function ($livewire) {
        $livewire->data['status'] = CarStatus::PENDING;
        $this->create();
    })
    ->requiresConfirmation()


If someone has a different more reliable approached i would love to here it.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Disable all browser validation
FilamentFFilament / ❓┊help
15mo ago
Disable "Save changes" button
FilamentFFilament / ❓┊help
3y ago
disable or fix fileupload validation
FilamentFFilament / ❓┊help
16mo ago
Disable Validation for other locales
FilamentFFilament / ❓┊help
3y ago