© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago
Ali

Weird Importer

The CSV file has 169179 lines, with duplicates (169030 without), after importing it with

public static function getChunkSize(): int
    {
        return 100;
    }

    public static function getColumns(): array
    {
        return [
            'reference' => ImportColumn::make('reference')
                ->requiredMapping()
                ->rules(['required', 'max:255']),
        ];
    }

    public function resolveRecord(): ?Driver
    {
        return Driver::firstOrNew([
            // Update existing records, matching them by `$this->data['column_name']`
            'reference' => $this->data['reference'],
        ]);

        // return new Driver();
    }

    public static function getCompletedNotificationBody(Import $import): string
    {
        $body = 'Your driver import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';

        if ($failedRowsCount = $import->getFailedRowsCount()) {
            $body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
        }

        return $body;
    }
public static function getChunkSize(): int
    {
        return 100;
    }

    public static function getColumns(): array
    {
        return [
            'reference' => ImportColumn::make('reference')
                ->requiredMapping()
                ->rules(['required', 'max:255']),
        ];
    }

    public function resolveRecord(): ?Driver
    {
        return Driver::firstOrNew([
            // Update existing records, matching them by `$this->data['column_name']`
            'reference' => $this->data['reference'],
        ]);

        // return new Driver();
    }

    public static function getCompletedNotificationBody(Import $import): string
    {
        $body = 'Your driver import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';

        if ($failedRowsCount = $import->getFailedRowsCount()) {
            $body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
        }

        return $body;
    }


I got the filament notification AND the table count rows not the same number, no error on the notification and no logs, what can I do ?
image.png
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

Importer issue
FilamentFFilament / ❓┊help
6mo ago
product importer
FilamentFFilament / ❓┊help
12mo ago
Importer RowImportFailedException
FilamentFFilament / ❓┊help
2y ago
CSV Importer
FilamentFFilament / ❓┊help
2y ago