laravel-import-export
laravel-import-export copied to clipboard
Method name must be a string
When importing data to an existing table get error 'Method name must be a string'
In this file, I am not sure why the author of this great bundle decided to delete tables everytime you upload and run a new file. Anyway, besides this little bug, it is a great bundle. The file in question is:
vendor/jacopo/laravel-import-export/src/Jacopo/LaravelImportExport/Models/ParseCsv/CsvFileHandler.php
I just commented out the following section and the script works great:
public function saveToDb(Array $columns_type)
{
$csv_file = $this->csv_file;
// create schema if not exists
if( ! empty($columns_type))
{
$line = $csv_file[0];
// $dbm = new DBM(); // =======>Comment out
// $dbm->createTable($line->getTableName(), $columns_type); // =======>Comment out
}