megacolorboy

Back

Published on May 25th, 2020

Laravel

Integrate Excel into your Laravel project

Before you integrate Excel into your application, make sure your project meets the following requirements:PHP v7.0 or greaterLaravel v5.5 or greaterPhpSpreadsheet v1.6 or greaterDownload the packageDownload the package using Composer:Add it to service providerBy default, this will be done automatically when you're installing the package but if you want to do it yourself, add this in your file:Publish your configurationLast but not the least, run the command using to publish your configuration:Upon publishing, the configuration file will be created where you can make your changes.Hope this helps you out!

1 minute read

Before you integrate Excel into your application, make sure your project meets the following requirements:

Download the package

Download the maatwebsite/excel package using Composer:


composer require maatwebsite/excel

Add it to service provider

By default, this will be done automatically when you're installing the package but if you want to do it yourself, add this in your config/app.php file:


<?php
...
'providers' => [
    ...
    Maatwebsite\Excel\ExcelServiceProvider::class,
],

...
'aliases' => [
    ...
    'Excel' => 'Maatwebsite\Excel\Facades\Excel::class',
],
?>

Publish your configuration

Last but not the least, run the vendor:publish command using artisan to publish your configuration:


php artisan vendor:publish -provider="Maatwebsite\Excel\ExcelServiceProvider"

Upon publishing, the config/excel.php configuration file will be created where you can make your changes.

Hope this helps you out!