Error installing Laravel 5 Excel

I have a hard time trying to install the Laravel Excel package ( http://www.maatwebsite.nl/laravel-excel/docs ) in my Laravel 5. Here is what I have done so far:

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

Here's the problem - when I try to run 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?

+5
source share
1 answer

I ran into the same problem and came to this question, but there was no clear solution. Therefore, I continue to search and found a simple solution.

The problem is with the cached configuration file. So for Laravel 5.1 just clear the cache

 php artisan config:cache 

and it worked great in my case. A source

+9
source

All Articles