{"id":37002353,"url":"https://github.com/zsardarov/php-excel-exporter","last_synced_at":"2026-01-14T00:28:38.580Z","repository":{"id":57092158,"uuid":"293905320","full_name":"zsardarov/php-excel-exporter","owner":"zsardarov","description":"A library that provides a way to easily export report data to excel.","archived":false,"fork":false,"pushed_at":"2021-03-17T18:17:25.000Z","size":7,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-21T01:10:15.864Z","etag":null,"topics":["excel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zsardarov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-08T19:16:50.000Z","updated_at":"2022-01-17T08:57:40.000Z","dependencies_parsed_at":"2022-08-22T21:40:12.585Z","dependency_job_id":null,"html_url":"https://github.com/zsardarov/php-excel-exporter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zsardarov/php-excel-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsardarov%2Fphp-excel-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsardarov%2Fphp-excel-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsardarov%2Fphp-excel-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsardarov%2Fphp-excel-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zsardarov","download_url":"https://codeload.github.com/zsardarov/php-excel-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsardarov%2Fphp-excel-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","php"],"created_at":"2026-01-14T00:28:37.727Z","updated_at":"2026-01-14T00:28:38.563Z","avatar_url":"https://github.com/zsardarov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Excel Exporter\n\nA package for exporting your reports from Database (or any other source) to Excel (.xlsx). \n\n## Installation\n\nInstall this package via Composer:\n```bash\n$ composer require zsardarov/php-excel-exporter\n```\n\n## Basic Usage\n\nFirstly create the factory. Pass the heading row and exportable data to it. \nAfter all the response can be sent to client. Example:\n\n```php\nuse Zsardarov\\ExcelExporter\\ExcelResponseFactory;\n\n\n$heading = ['id', 'title', 'content'];\n$exportable = [\n    [1, 'Lorem', 'ipsum'],\n    [2, 'Sample', 'data']\n];\n\n$factory = new ExcelResponseFactory();\n\nreturn $factory-\u003esetHeadingRow($heading)\n     -\u003ecreateFrom($exportable)\n     -\u003esend();\n```\n\n## Custom Factories\n\nAlso, you may extend basic functionality by creating custom factories. For this purpose you must inherit your factory from `BaseExcelFactory class`. Example:\n\n```php\nuse Box\\Spout\\Writer\\Common\\Creator\\WriterEntityFactory;\nuse Box\\Spout\\Writer\\XLSX\\Writer;\nuse Zsardarov\\ExcelExporter\\BaseExcelResponseFactory;\n\nclass CustomExcelResponseFactory extends BaseExcelResponseFactory\n{\n    protected function getHeadingRow(): ?array\n    {\n        return [\n            'id',\n            'category',\n            'value',\n            'date'\n        ];\n    }\n\n    protected function contentWriter(Writer $writer, iterable $exportable): void\n    {\n        foreach ($exportable as $item) {\n            $cells = [\n                $item-\u003eid,\n                $item-\u003ecategory,\n                $item-\u003evalue,\n                $item-\u003edate\n            ];\n\n            $row = WriterEntityFactory::createRowFromArray($cells);\n            $writer-\u003eaddRow($row);\n        }\n    }\n}\n```\n\n```php\nuse App\\Models\\Report;\nuse App\\Services\\CustomExcelResponseFactory;\n\nclass SampleController extends Controller\n{\n    public function export()\n    {\n        $exportable = Report::all();\n        $factory = new CustomExcelResponseFactory();\n\n        return $factory-\u003ecreateFrom($exportable, 'report.xlsx');\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsardarov%2Fphp-excel-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzsardarov%2Fphp-excel-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsardarov%2Fphp-excel-exporter/lists"}