Package for easy loading csv files into DB
This package for Laravel 5.4+ allows you to easily and quickly insert data from a CSV file into a database., (*1)
The package works with the MySql and uses INFORMATION_SCHEMA
, (*2)
Before using the software, you need to create a model and a table in the database., (*3)
The fields of the csv file must match the fields in the DB table., (*4)
Installation., (*5)
1/ Install with Composer, (*6)
composer require zvg/csvload
or, (*7)
add in composer.json, (*8)
"require": { ... "zvg/csvload": "*", ... }
2/ Add the service provider to config/app.php, (*9)
'providers' => [ '...', 'Zvg\CsvLoad\CsvLoadServiceProvider::class', ];
3/ Publish files, (*10)
php artisan vendor:publish --provider="Zvg\CsvLoad\CsvLoadServiceProvider"
Using., (*11)
Insert into your blade ( 'admin' or other ) form to load CSV file., (*12)
@include('zvg::csv_form',['model' => 'your model'])
You need insert full model name ( for exemple @include('zvg::csv_form',['model' => '\App\Adress']))., (*13)