2

I'm using Maatwebsite Laravel Excel to export .xls documents. In my 'localhost' it works perfectly, but when I try to do it in production, show me this error:

FatalThrowableError in Facade.php line 237:
Call to undefined method Maatwebsite\Excel\Facades\Excel::create()

I follow all the instalation instructions in: Laravel Excel

I also can't run "composer update" in production with SSH because the process is "killed"... I don't know why.

Do I really have to run the composer update? Is this why?

I'm using PHP 7.0 and Laravel 5.3, so I use the Laravel Excel version 2.1, the 3 version is only for Laravel >5.5.

Please help me!

Thanks in advance for your help.

André Giuly
  • 19
  • 1
  • 6

2 Answers2

0

I think you have not added Maatwebsite\Excel\Facades\Excel facade string in the providers array in app.php on production site?

As you are not able to run composer update due to process killed, see here hint related to updating on a hint related to updating on the server.

  1. Run composer update in a local environment (either your local physical machine, or a development virtual machine)
  2. Upload or git push the composer.lock file
  3. Run composer install on the live server
pspatel
  • 508
  • 2
  • 7
  • 18
  • 1
    I added this to providers array : Maatwebsite\Excel\ExcelServiceProvider::class, And this to aliases: 'Excel' => Maatwebsite\Excel\Facades\Excel::class, – André Giuly May 30 '18 at 12:00
  • Maybe something is breaking, try to run the composer update or upload the exact same file and other things related to this package on the server. – pspatel May 30 '18 at 12:19
  • Thank you! The problem is... When I try to run "composer update", the process is "Killed" -_-' – André Giuly May 30 '18 at 12:49
  • I do it... I've runned composer update in my local machine. I upload the composer.lock file to server by Filezilla But when I tried to run "composer install" - the terminal shows me "The compiled class file has been removed" :\ – André Giuly Jun 01 '18 at 11:07
0

SOLVED

  1. I runned "php artisan config:clear" and the error has changed to:

[screenshot][1]

  1. I've uploaded (again) my "config/app.php" and then it told me:

"Permission denied to write in "bootstrap/cache"

  1. So I "sudo chmod -R 777 /bootstrap"

Thank you.

André Giuly
  • 19
  • 1
  • 6