bluora / laravel-seed-from-file
Provides the ability to import a file or files from a folder into your database.
Requires
- php: >=7.0.10
- league/csv: ^9.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- illuminate/database: 4.*|5.*
- phpunit/phpunit: 5.7
- symfony/process: ~2.3
This package is not auto-updated.
Last update: 2022-02-01 13:03:56 UTC
README
Provides the ability to import data (raw sql or CSV) from a file or from files found in the supplied folder.
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.
Install
Via composer:
$ composer require-dev hnhdigital-os/laravel-seed-from-file ~1.0
This package autoloads from Laravel 5.5.
For Laravel 5.4 and below, enable the service provider by editing config/app.php:
'providers' => [ ... HnhDigital\LaravelSeedFomFile\ServiceProvider::class, ... ];
Usage
Raw SQL
# php artisan db:seed-from-raw {dir} {--connection}
- {dir} - A file or a directory.
- {--connection} - Set the connection that will be used when importing. Defaults to
Config::get('default')
.
CSV
# php artisan db:seed-from-csv {dir} {--connection}
- {dir} - A file or a directory.
- {--connection} - Set the connection that will be used when importing. Defaults to
Config::get('default')
.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.