marshallgosling / php-excel
phpExcel for Laravel
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/marshallgosling/php-excel
Requires
- php: ^7.3|^8.0
This package is auto-updated.
Last update: 2025-11-13 12:43:24 UTC
README
PHPExcel library compatible with Laravel Framework >= 8.x
use Nathan\PHPExcel\IOFactory; use Nathan\PHPExcel\PHPExcel; function createObj() { $objPHPExcel = new PHPExcel(); // Set document properties $objPHPExcel->getProperties()->setCreator($creator) ->setLastModifiedBy($creator) ->setTitle($title) ->setSubject($subject) ->setDescription($description) ->setKeywords($keywords) ->setCategory($category); } function loadTemplate($file) { $objPHPExcel = IOFactory::load($file); } function outputFile($filename, $mode='file') { $objWriter = IOFactory::createWriter($objPHPExcel, 'Excel2007'); if($mode == 'stream') { // Redirect output to a client’s web browser (Excel2007) header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="'.$filename.'"'); header('Cache-Control: max-age=1920'); $objWriter->save('php://output'); exit; } if($mode == 'file') { $objWriter->save($filename); } }