Laravel Load File is a package to help with loading files into MySQL tables. This uses MySQL's LOAD DATA statement to load text files quickly into your database.
This library currently can handle any of the options in a normal LOAD DATA statement except for the partitioned table support.
LoadFile::file('/path/to/employees.csv', $local = true) ->into('employees') ->columns(['forename', 'surname', 'employee_id']) // like this ->fieldsTerminatedBy(',') ->fieldsEscapedBy('\\\\') ->fieldsEnclosedBy('"') // or ->fields(',', '\\\\', '"') ->load(); Loading data into Eloquent Models
Then you can use the following method to load a file into that table: User::loadFile('/path/to/users.csv', $local = true); Need to specify options to load the file with?