Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 Excel installation failure

I am having a rough time trying to install the Laravel Excel (http://www.maatwebsite.nl/laravel-excel/docs) package to my Laravel 5. Here's what I've done so far:

  • Added "maatwebsite/excel": "2.*" to my require, composer update finishes just fine and I have all the package files
  • Added 'Maatwebsite\Excel\ExcelServiceProvider', to providers array
  • Added 'Excel' => 'Maatwebsite\Excel\Facades\Excel', to aliases array

Here's the problem - when I try running php artisan vendor:publish, it tells me Nothing to publish for tag [].

When I use php artisan tinker and run $excel = App::make('excel'), it tells me ReflectionException with message 'Class excel does not exist'.

What am I doing wrong?

like image 859
Salkz Avatar asked Jul 18 '15 12:07

Salkz


1 Answers

I was facing the same problem and came to this question but there wasn't any clear solution. So I keep searching and found a simple solution.

The problem is related with the cached config file. So for Laravel 5.1, just clear the cache

php artisan config:cache

and it worked perfectly in my case. Source

like image 165
Ariful Haque Avatar answered Nov 04 '22 07:11

Ariful Haque