Objective
I'm trying to run the package PhpSpreadsheet on Laravel.
Problem
When I try to execute the hello example from the documentation, but I got this error:
main(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR')
Steps
I've tried to follow the documentation then I did the following:
-
After running:
composer require phpoffice/phpspreadsheet
I got this result -
composer update
gave me this -
Finally,I tried to run the hello-example class as follow:
require 'vendor/autoload.php'; class Spread{ public function fun(){ $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('A1', 'Hello World !'); $writer = new Xlsx($spreadsheet); $writer->save('helloz world.xlsx'); }
Composer.json
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire