ProductImport::class]; ExcelFacade::import(new $importers[$request->import_type], $request->file('csv_file'), null, Excel::CSV); if (session()->has('importer_errors')) { return back()->with('error', trans('import::messages.there_was_an_error_on_rows', [ 'rows' => implode(', ', session()->pull('importer_errors', [])), ])); } return back()->with('success', trans('import::messages.the_importer_has_been_run_successfully')); } }