import-excel-laravel

Import Excel data in Laravel 5.3

In my previous post explains Export data to Excel or CSV in Laravel 5.3 . This article explains import excel data into database table. For doing this i used ‘maatwebsite/excel’  library. Simply follow below steps.

 

step 1 : Installation

Open composer and add below line of code.

Update composer i.e., Run the command ‘composer update

step 2 : Add service provider and aliase

Open ‘config/app.php’ and add below code.

Then ,  run ‘php artisan vendor:publish‘ command.

step 3 : Create table

step 4 : step 4 : Routing (app/Http/routes.php)

 

step 5 : Controller

(app/Http/Controllers/ImportExcelController.php)

 

step 6 : Views

(resources/views/import/index.blade.php)

Sample Screen shorts :

import-excel-laravel-1

 

import-excel-laravel-2

 

import-excel-laravel-3

  • 張碰騰

    感謝分享您的文章,非常受益。