close

[Solved] Call to undefined method Maatwebsite\Excel\Excel::load()

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Call to undefined method Maatwebsite\Excel\Excel::load() in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Call to undefined method Maatwebsite\Excel\Excel::load() Error Occurs?

Today I get the following error Call to undefined method Maatwebsite\Excel\Excel::load() in php.

How To Solve Call to undefined method Maatwebsite\Excel\Excel::load() Error ?

  1. How To Solve Call to undefined method Maatwebsite\Excel\Excel::load() Error ?

    To Solve Call to undefined method Maatwebsite\Excel\Excel::load() Error Hi there in version 3 the load method was remove so switch back to version two like so try using this command,
    composer require "maatwebsite/excel:~2.1.0"

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

    To Solve Call to undefined method Maatwebsite\Excel\Excel::load() Error Hi there in version 3 the load method was remove so switch back to version two like so try using this command,
    composer require "maatwebsite/excel:~2.1.0"

Solution 1

^3.0 versions of maatwebsite/excel does not support loads.
Delete the config/excel.php file first .

Downgrade the maatwebsite/excel version by changing your composer.json file from "maatwebsite/excel": "^3.1", to "maatwebsite/excel": "~2.1.0", and performing ‘composer update’.

And if you get an error:

Undefined class constant ‘XLSX’ in 2.1 version

this is what you have to do.
Delete the config/excel.php before downgrading then perform the composer update.

Solution 2

Hi there in version 3 the load method was remove so switch back to version two like so try using this command,

composer require "maatwebsite/excel:~2.1.0"

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment