Below is an example of using the PHPEXCEL library with laravel 5
1: - Install the "phpoffice" package in Laravel 5. Below is the link for packages
2: - Add "phpexcel / phpexcel": "dev-master" to your composer.json. Example: - "required": {"phpexcel / phpexcel": "dev-master"}
3: - Then do the “composer update”.
4: - Open the file "/vendor/composer/autoload_namespaces.php". Insert the bottom line into the file.
// Enable PHPEXCEL library with Laravel 5
'PHPExcel' => array ($ vendorDir. '/ Phpoffice / phpexcel / Classes'),
5: - Now you can use the PHPEXCEL library in your controllers or middleware or library. Use PHPExcel use PHPExcel_IOFactory;
For more information, you can access the link https://github.com/pantlavanya/export-to-excel-using-phpoffice-phpexcel-in-laravel-5 .
source share