https://github.com/duckthom/laravel-importer
Extensible importer for Laravel
https://github.com/duckthom/laravel-importer
importer laravel laravel-package laravel5-package php7
Last synced: 24 days ago
JSON representation
Extensible importer for Laravel
- Host: GitHub
- URL: https://github.com/duckthom/laravel-importer
- Owner: DuckThom
- License: mit
- Created: 2017-02-18T00:24:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-05T21:00:10.000Z (over 7 years ago)
- Last Synced: 2025-03-27T06:34:42.708Z (about 1 month ago)
- Topics: importer, laravel, laravel-package, laravel5-package, php7
- Language: PHP
- Homepage:
- Size: 49.8 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Importer
# Prerequisites
Before using this package, make sure you are at least running PHP 7.0 and that you have Laravel 5.4.
# Setup
First, add this package to your `composer.json`:
```
composer require luna/laravel-importer "~1.0"
```Add the service provider and facade to `config/app.php`:
```php
'providers' => [
// ...
// Package providersLuna\Importer\ServiceProvider::class,
],'aliases' => [
// ..."Import" => Luna\Importer\ImporterFacade::class
]
```Publish the configuration:
```
php artisan vendor:publish --provider="Luna\Importer\ServiceProvider"
```# Features
This plugin currently only comes with a CSV runner which means it is only able to parse CSV files out of the box. There will be more info on how to add runners added later.
# Documentation
http://laravel-importer.readthedocs.io/en/latest/
# Example configuration
`config/importer.php`:
```php
return [
/***********************************************************
* Importers are used for defining specific import tasks
* For instance, a ProductImporter could import a file with
* products into a table.
***********************************************************/
'importers' => [
'default' => \App\Importers\ProductImporter::class
],/***********************************************************
* Runners are used for looping through the file
* The default is a CSV runner which will loop though
* CSV files line-by-line. A runner uses an importer to get
* import specific settings like the model class.
***********************************************************/
'runners' => [
'default' => \Luna\Importer\Runners\CsvRunner::class
]
];
```# Contributing
Pull requests for new features are welcome as long as they include tests for it as well.