この内容は古いバージョンです。最新バージョンを表示するには、戻るボタンを押してください。
バージョン:3
ページ更新者:atom
更新日時:2026-05-13 03:04:40

タイトル: ERROR: Call to undefined method Maatwebsite\Excel\Excel::load()

この記事の要点
  • 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に入れ替えること。