krayin/laravel-crm · error · InvalidArgumentException

Unsupported file type: $fileType

Error message

Unsupported file type: $fileType

What it means

Error "Unsupported file type: $fileType" thrown in krayin/laravel-crm.

Source

Thrown at packages/Webkul/DataTransfer/src/Helpers/Import.php:524

        switch ($fileType) {
            case 'csv':
                $writer = new Csv($spreadsheet);

                $writer->setDelimiter($this->import->field_separator);

                break;

            case 'xls':
                $writer = new Xls($spreadsheet);

            case 'xlsx':
                $writer = new Xlsx($spreadsheet);

                break;

            default:
                throw new \InvalidArgumentException("Unsupported file type: $fileType");
        }

        $errorFilePath = 'imports/'.time().'-error-report.'.$fileType;

        $writer->save(Storage::disk('public')->path($errorFilePath));

        return $errorFilePath;
    }

    /**
     * Validates source file and returns validation result.
     */
    public function getTypeImporter(): AbstractImporter
    {
        if (! $this->typeImporter) {
            $importerConfig = config('importers.'.$this->import->type);

            $this->typeImporter = app()->make($importerConfig['importer'])

View on GitHub (pinned to 13d6988cda)

When it happens

Trigger: Thrown at packages/Webkul/DataTransfer/src/Helpers/Import.php:524 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of krayin/laravel-crm@13d6988cda (2026-08-17). Data as JSON: /api/errors/edf573b9ddccdb1d. Report an issue: GitHub.