Download the PHP package bayareawebpro/laravel-simple-csv without Composer
On this page you can find all versions of the php package bayareawebpro/laravel-simple-csv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bayareawebpro/laravel-simple-csv
More information about bayareawebpro/laravel-simple-csv
Files in bayareawebpro/laravel-simple-csv
Package laravel-simple-csv
Short Description A simple CSV importer/ exporter for Laravel.
License MIT
Informations about the package laravel-simple-csv
Laravel Simple CSV
https://packagist.org/packages/bayareawebpro/laravel-simple-csv
Features
- Import to LazyCollection.
- Export from Collection, LazyCollection, Iterable, Generator, Array.
- Low(er) Memory Consumption by use of LazyCollection Generators.
- Uses Native PHP SplFileObject.
- Facade Included.
Installation
Require the package and Laravel will Auto-Discover the Service Provider.
Usage:
Invokable classes can be passed to the import method allowing you to customize how each row is processed. Two classes to handle numerics and null values have been supplied.
Invokable Classes
Dependency Injection: Invokable classes can typehint required dependencies in a constructor method when defined.
Export to File
Export Download Stream
Override Options
Or, Create a Config File
config/simple-csv.php
File Splitting Utility
A file splitting utility has been included that will break large CSV files into chunks (while retaining column headers) which you can move/delete after importing. This can help with automating the import of large data sets.
Tip: Find your Bash Shell Binary Path: which sh
Speed Tips
- Using Lazy Collections is the preferred method.
- Using the queue worker, you can import a several thousand rows at a time without much impact.
- Be sure to use "Database Transactions" and "Timeout Detection" to insure safe imports.
- Article: How to Insert & Update Many at Once