Search code examples
phplaravel-5phpexcelimplements

PHPExcel for laravel 5


I want to use my PHPExcel Laravel application. I installed the library in the vendor directory. What is the method to call my controller and thereby implement this example: http://g-ernaelsten.developpez.com/tutoriels/excel2007/?page=fondements#L2.1 In the posts I read it just had to write to the header

use PHPExcel; use PHPExcel_IOFactory;

It's not sufficient

Who can help me start with this library? and integrate it into my project Laravel. Thank


Solution

  • Maatwebsite made a built a Laravel package for PHPExcel. You can find it here https://github.com/Maatwebsite/Laravel-Excel together with the documentation for it.

    If for any reasons you prefer to not use this, you need to

    include '/vendor/PHPExcel/PHPExcel';
    include '/vendor/PHPExcel/PHPExcel/Writer/Excel5.php';