├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── config └── data-bringin.php ├── img.png ├── img_1.png ├── resources └── views │ └── import.blade.php ├── routes └── web.php └── src ├── Http ├── Controllers │ ├── Controller.php │ └── ImportController.php └── Requests │ ├── ImportRequest.php │ └── StoreImportRequest.php ├── Providers └── ImportServiceProvider.php └── Services └── ImportService.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | /vendor 3 | /.idea 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `laravel-data-bringin` will be documented in this file 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests on [Github](https://github.com/vcian/laravel-data-bringin). 6 | 7 | Please read and understand the contribution guide before creating an issue or pull request. 8 | 9 | ## Protocol 10 | 11 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 12 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 13 | extremely unfair for them to suffer abuse or anger for their hard work. 14 | 15 | ## Pull Requests 16 | 17 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). 18 | 19 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 20 | 21 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 22 | 23 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 24 | 25 | - **Create feature branches** - Don't ask us to pull from your master branch. 26 | 27 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 28 | 29 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 30 | 31 | **Happy coding**! 32 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) ViitorCloud (https://viitorcloud.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Data Bringin 2 | 3 | [](https://packagist.org/packages/vcian/laravel-data-bringin) 4 | [](https://packagist.org/packages/vcian/laravel-data-bringin) 5 | 6 | ## What It Does 7 | 8 | This package provides an easy and flexible way to import any kind of dynamic CSV files to a Laravel application's database. 9 | With this package, you can define your import mappings, which allows you to map columns in your CSV files to specific fields in your database tables. 10 | 11 | ## Installation & Usage 12 | 13 | > **Requires [PHP 8.0+](https://php.net/releases/) | [Laravel 8.0+](https://laravel.com/docs/8.x)** 14 | 15 | Require Laravel Data Bringin using [Composer](https://getcomposer.org): 16 | 17 | ```bash 18 | composer require vcian/laravel-data-bringin 19 | ``` 20 | ## Usage: 21 | 22 | You can access Data Brigin view via below route 23 | 24 | **Access Route:** http://yourdomain.com/data-bringin 25 | 26 |  27 | 28 | **Note:** 29 | 30 | 1) Don't forget to replace your actual domain with "yourdomain.com" 31 | 32 | 2) You can also update your custom route with config/data-brigin.php 33 |  34 | 35 | 3) By default, data-bringin support import data upto **10,000** records. 36 | If you want to upgrade more capacity than you have to make changes in php.ini file below parameter values. 37 | ```bash 38 | max_execution_time 39 | post_max_size 40 | memory_limit 41 | max_input_vars 42 | ``` 43 | 44 | 45 | 46 | ## Changelog 47 | 48 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 49 | 50 | ## Contributing 51 | 52 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 53 | 54 | ## Security 55 | 56 | If you discover any security-related issues, please email ruchit.patel@viitor.cloud instead of using the issue tracker. 57 | 58 | ## Credits 59 | 60 | - [All Contributors](../../contributors) 61 | 62 | ## License 63 | 64 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 65 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vcian/laravel-data-bringin", 3 | "description": "Dynamic import csv and column mapping to a Laravel application mysql database.", 4 | "keywords": [ 5 | "laravel", 6 | "import", 7 | "csv-import", 8 | "dynamic-import", 9 | "datamapping", 10 | "csv import to mysql database", 11 | "database", 12 | "dynamic", 13 | "larage data import", 14 | "csv bulk data import", 15 | "csv", 16 | "csv data import", 17 | "mysql" 18 | ], 19 | "type": "library", 20 | "license": "MIT", 21 | "authors": [ 22 | { 23 | "name": "Vcian - ViitorCloud", 24 | "homepage": "https://github.com/vcian", 25 | "role": "Developer" 26 | } 27 | ], 28 | "require": { 29 | "php": "^8.0" 30 | }, 31 | "autoload": { 32 | "psr-4": { 33 | "Vcian\\LaravelDataBringin\\": "src/" 34 | } 35 | }, 36 | "minimum-stability": "dev", 37 | "extra": { 38 | "laravel": { 39 | "providers": [ 40 | "Vcian\\LaravelDataBringin\\Providers\\ImportServiceProvider" 41 | ] 42 | } 43 | }, 44 | "require-dev": { 45 | "laravel/pint": "dev-main" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /config/data-bringin.php: -------------------------------------------------------------------------------- 1 | env('DATA_BRINGIN_PATH', 'data-bringin'), 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Data Bringin Route Middleware 19 | |-------------------------------------------------------------------------- 20 | | 21 | | These middleware will be assigned to every Data Bringin route, giving you 22 | | the chance to add your own middleware to this list or change any of 23 | | the existing middleware. Or, you can simply stick with this list. 24 | | 25 | */ 26 | 27 | 'middleware' => [ 28 | 'web', 29 | ], 30 | ]; 31 | -------------------------------------------------------------------------------- /img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vcian/laravel-data-bringin/34bebf6b764ca09738bd83f0e8560548b18d28d3/img.png -------------------------------------------------------------------------------- /img_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vcian/laravel-data-bringin/34bebf6b764ca09738bd83f0e8560548b18d28d3/img_1.png -------------------------------------------------------------------------------- /resources/views/import.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |Total {{ $result['count'] }} data has been imported!
1139 |{{ $result['error'] }}
1145 |