In Laravel 4 I could easily install PhpExcel by putting "phpoffice/phpexcel": "dev-master" in composer.json and then do 'composer install' in terminal. It would work perfectly then.
In Laravel 5 however I keep getting "Class 'App\Http\Controllers\PHPExcel' not found". I tried some things with namespaces but to no avail:
I tried using "<?php namespace App\Vendor\Phpoffice\Phpexcel\Classes;" to PHPExcel.php and "use App\Vendor\Phpoffice\Phpexcel\Classes;" in my controller. This didn't work.
I have to admit that I don't quite understand this namespacing stuff in the first place so I don't really feel like I don't know what I'm doing :).
Any pointers? Thanks!
I use https://github.com/Maatwebsite/Laravel-Excel easily enough. IN my composer file it reads
"require": {
"maatwebsite/excel": "~2.0.0",
},
and referenced as
\Excel
Good luck.
Add this namespace and it should work if the package has been installed: <code> use PHPExcel_IOFactory; </code>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community