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

acitjazz's avatar

Export To Excel Laravel 5.2

I'm using laravel 5.2 and I try using this package https://github.com/Maatwebsite/Laravel-Excel

but when composer update i get this error

Composer update fails with: Your requirements could not be resolved to an installable set of packages

how to fix it?

0 likes
2 replies
noeldiaz's avatar

I just tested pulling a fresh install of 5.2 (5.2.22) and I added this to composer:

"maatwebsite/excel": "~2.1.0"

And then did composer update and it pulled it down correctly. Maybe you have a typo?

1 like
zahidgani's avatar

use App\Models\Users; use Excel; $data = Users::get()->toArray();

    return Excel::create('test', function($excel) use ($data) {
        $excel->sheet('mySheet', function($sheet) use ($data)
        {
            $sheet->fromArray($data);
        });
    })->download($type);

when we try to run it generate error

FatalThrowableError in IOFactory.php line 141: Class 'PHPExcel_Writer_' not found

please solve the problem

Please or to participate in this conversation.