How to install PHPExcel library in laravel 5

You should use composer: Add “phpexcel/phpexcel”: “dev-master” to your composer.json and composer update.

"require": {
    "phpexcel/phpexcel": "dev-master"
}

Then execute composer update.

Open the file “/vendor/composer/autoload_namespaces.php”. add below code may be allready available.

<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'),
    'PHPExcel' => array($vendorDir . '/phpoffice/phpexcel/Classes', $vendorDir . '/phpexcel/phpexcel/Classes'),
    'Mockery' => array($vendorDir . '/mockery/mockery/library'),
    'Maatwebsite\\Excel\\' => array($vendorDir . '/maatwebsite/excel/src'),
    'JakubOnderka\\PhpConsoleHighlighter' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'),
    'JakubOnderka\\PhpConsoleColor' => array($vendorDir . '/jakub-onderka/php-console-color/src'),
    'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
);

Leave a Reply

Your email address will not be published. Required fields are marked *