Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amk's avatar
Level 4

Call to undefined method Maatwebsite\Excel\Excel::create()

Hi,guys... I have been add providers and aliases. I can't find yet! Still, I got the error message

 Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method Maatwebsite\Excel\Excel::create()

and my package version

        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "maatwebsite/excel": "^3.1",
        "predis/predis": "^1.1",
        "uxweb/sweet-alert": "^2.0"

controller

use Excel;

    public function export_list()
    {
      Excel::create('Export data', function($excel) {

      $excel->sheet('Sheet', function($sheet) {
      $data = User::where('city','ygn')->get();

       $sheet->fromArray($data);
      });
    })->download('xls');
    }

Pls,can you suggest me?

0 likes
1 reply
D9705996's avatar
D9705996
Best Answer
Level 51

You need to update your code as per the upgrade guide as ::create has been removed. use Excel::download() or Excel::store() instead

5 likes

Please or to participate in this conversation.