Laravel2系のサポート終了ということで、
とりあえずのしのぎとして、プロジェクト内でモジュールを保持することを検討しています。
以下のような対応をしましたが、
Call to undefined method Maatwebsite\Excel\Facades\Excel::create()
となってしまい、ローカルのLaravelExcelが認識されていないようです。
対応内容
- require から削除
composer remove maatwebsite/excel
- GitHubからZIPダウンロードして、ext_lib/以下に配置
ext_lib/ Laravel-Excel-2.1/ ・・・ PHPExcel-1.8/ ・・・
- composer.json(プロジェクトのもの)の、autoloadに以下を追加(※ 元あったものは省略して記載)
"classmap": [ "ext_lib/Laravel-Excel-2.1/src/Maatwebsite/Excel" ], "psr-0":{ "Maatwebsite\Excel\": "ext_lib/Laravel-Excel-2.1/src/", "PHPExcel": "ext_lib/PHPExcel-1.8/Classes/" }
- config/app.php(※ 元あったものは省略して記載)
'aliases' => [ 'Excel' => Maatwebsite\Excel\Facades\Excel::class, ];
- composer install
Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump
vender/composer/autoload_classmap.phpには、下記の通り反映されているように見えました。
'Maatwebsite\Excel\Facades\Excel' => $baseDir . '/ext_lib/Laravel-Excel-2.1/src/Maatwebsite/Excel/Facades/Excel.php',
「ここを見てみろ」といった情報などでもあれば頂けますでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。