© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Zoltar

Filament Importer skip import row if certain conditions is true

I create a simple importer that import only one column "email".
The importer works properly, now i try to stop import row if email has already been imported

I try to use beforeValidate hooks, but it doesn't seem to work.

alternative to $this->action->halt(); ???

thank you always for your availability

protected function beforeValidate(): void 
    {
        $user = User::where('email', $this->data['email'])->first();
            if ($user) {
                Notification::make()
                    ->danger()
                    ->title('User already exist')
                    ->body('This email has already been used for a user on the platform')
                    ->persistent()
                    ->send();

                $this->action->halt();
            }
    }
protected function beforeValidate(): void 
    {
        $user = User::where('email', $this->data['email'])->first();
            if ($user) {
                Notification::make()
                    ->danger()
                    ->title('User already exist')
                    ->body('This email has already been used for a user on the platform')
                    ->persistent()
                    ->send();

                $this->action->halt();
            }
    }
Solution
ok its worked, i add the code in public function resolveRecord() function and use Filament\Actions\Imports\Exceptions\RowImportFailedException;
image.png
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

make:filament-importer is not defined.
FilamentFFilament / ❓┊help
3y ago
How to import belongsToMany fields in the filament importer?
FilamentFFilament / ❓┊help
3y ago
Translating Filament CSV Importer
FilamentFFilament / ❓┊help
13mo ago
Skip Import when model is existing
FilamentFFilament / ❓┊help
3y ago