laravel-import-export icon indicating copy to clipboard operation
laravel-import-export copied to clipboard

Method name must be a string

Open daimob opened this issue 11 years ago • 1 comments

When importing data to an existing table get error 'Method name must be a string'

daimob avatar Mar 30 '14 12:03 daimob

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
    }

akkaweb avatar Oct 10 '14 04:10 akkaweb