{"repo":"ellgreen/laravel-loadfile","free":true,"listed":false,"github":"https://github.com/ellgreen/laravel-loadfile","clone":"git clone https://github.com/ellgreen/laravel-loadfile.git","description":"MySQL Load Data Infile Support For Laravel","language":"PHP","stars":82,"topics":["mysql","database","laravel","loaddata","infile","load-data-infile","load","csv","tsv","php"],"license":"MIT","category":"databases-storage","readme_excerpt":"Laravel Load File 💽 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 is usually 20 times faster than using INSERT statements according to: https://dev.mysql.com/doc/refman/8.0/en/insert-optimization.html Options This library currently can handle any of the options in a normal LOAD DATA statement except for the partitioned table support. This will be included in a future release of laravel-loadfile. Further information on the following options that can be passed to the load file builder can be found here: https://dev.mysql.com/doc/refman/8.0/en/load-data.html Installation Requires = PHP 8.2 and = Laravel 12 Older versions of Laravel and PHP are supported through previous major versions of this library Loading files To use local files you will need to have local infile enabled for the client and server. To do this on the Laravel side you will need to add the following to the options part of your database config: Simple file import Ignoring header row Specifying field options Specifying line options Input preprocessing (set) Using a different connection Duplicate-key and error handling Loading data into Eloquent Models Simply add the LoadsFiles trait to your model like so: Then you can use the following method to load a file into that table: Need to specify options to load the file with? Add the following method to your Model Or you can get an instance of the query builder on the fl","default_branch":null,"files":null,"tree":[],"storefront":"/r/ellgreen","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ellgreen/laravel-loadfile/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}