4.

ERROR: Call to undefined method Maatwebsite\Excel\Excel::loa

編集
この記事の要点
  • Laravel の Call to undefined method Maatwebsite\Excel\Excel::load()
  • 原因: maatwebsite/excel パッケージのバージョン違い。3.x 系で ::load() が廃止された
  • 対処1: 新 API Excel::import(new MyImport, $file) を使う
  • 対処2: 2.x 系にダウングレード(composer require maatwebsite/excel:~2.1

 

エラー内容

local.ERROR: Call to undefined method Maatwebsite\Excel\Excel::load() 

 

発生条件/原因

maatwebsite/excel」パッケージの「Excel::load」を使用した際に発生するエラー。

 

対処法

恐らく、「maatwebsite/excel」のversion3をインポートしたことが原因。

当バージョンではインポートをサポートしていないので(2018/5/5現在)、バージョン2に入れ替えること。

 

編集
Post Share
子ページ

子ページはありません

同階層のページ
  1. Fatal error: Maximum execution time of 30 seconds exceeded in...
  2. Fatal error: Uncaught Error: Cannot use object of type stdClass as array in ...
  3. Warning: Use of undefined constant ... - assumed '...' (this will throw an Error)
  4. ERROR: Call to undefined method Maatwebsite\Excel\Excel::load()
  5. Maximum execution time of 30 seconds exceeded
  6. Your requirements could not be resolved to an installable set of packages. ... To enable extensions, verify that they are enabled in your .ini files:
  7. could not find driver
  8. the requested PHP extension mbstring is missing from your system.
  9. the requested PHP extension dom is missing from your system.
  10. A non well formed numeric value encountered
  11. Warning: Cannot modify header information - headers already sent by ...
  12. php_network_getaddresses: getaddrinfo failed: Name or service not known
  13. XMLWriter::openUri(): Unable to resolve file path
  14. Object of class stdClass could not be converted to string
  15. Class 'Google_Service_Youtube' not found