Maybe try
\Maatwebsite\Excel\Excel::create()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,I want to export file to excel.Even after following the steps which is shown in this link.
https://www.webslesson.info/2018/05/how-to-export-mysql-data-to-excel-file-in-laravel.html
i am getting error like this.
" Call to undefined method Maatwebsite\Excel\Excel::create() "
Guys please help me to solve this.
On the package website it says:
Deprecations
ALL Laravel Excel 2.* methods are deprecated and will not be able to use in 3.0 .
Excel::load() is removed and replaced by Excel::import($yourImport) Excel::create() is removed and replaced by Excel::download/Excel::store($yourExport) 3.0 provides no convenience methods for styling, you are encouraged to use PhpSpreadsheets native methods. You can find an example upgrade for an export here: https://github.com/Maatwebsite/Laravel-Excel/issues/1799
So use downloador storemethod.
Please or to participate in this conversation.