ticketpark/htmlphpexcel
HtmlPHPExcel is a PHP library for converting HTML tables into Excel workbooks via PHPExcel. It parses table markup and exports formatted data to spreadsheet files, simplifying HTML-to-Excel workflows in PHP projects.
Architecture fit. ticketpark/htmlphpexcel is a framework-agnostic utility library, not a Laravel package. It is Composer-installable and exposes a small surface area (parse an HTML table string into a spreadsheet object, save to .xls/.xlsx). That is a good architectural fit for a Laravel app because it can be treated as an infrastructure dependency behind a service interface, with no bootstrapping or framework coupling. It does not need a service provider and will not intrude on the container, so it is easy to isolate and swap.
Integration feasibility. Installing is trivial (composer require ticketpark/htmlphpexcel), and the API appears deliberately minimal. The feasibility question is not "can we wire it up" but "can we wire it up safely." The package is described as based on PHPExcel, which PhpSpreadsheet replaced and which PhpSpreadsheet's maintainers deprecated in 2017. The stated 2025-02-07 release date conflicts with that description, so the first task is a spike to confirm which spreadsheet engine the current release actually depends on. If it still pulls PHPExcel, feasibility drops sharply for any Laravel 10/11 application on PHP 8.1+.
Technical risk. High for a 75-star, single-maintainer library. Three concrete risks: (1) dependency risk—PHPExcel is abandoned and has known PHP 8 incompatibilities in some forks, and would collide with an existing phpoffice/phpspreadsheet dependency; (2) input risk—parsing arbitrary HTML means dealing with malformed markup, encoding, remote images, and spreadsheet formula injection (any cell beginning with =, +, -, or @ is a payload); (3) resource risk—PHPExcel is memory-hungry per cell, so large tables can exhaust memory. None of these are disqualifying, but each needs a decision.
Key questions to answer in the spike.
^8.1?) and does it pass on PHP 8.2/8.3?symfony/dom-crawler, masterminds/html5) with entity loading disabled?colspan/rowspan, inline styles, images, merged cells, and UTF-8?Verdict. Viable for a narrow, low-stakes use case (export a server-rendered HTML table to .xlsx), with a low opportunity score suggesting it is not a strategic bet. Not viable as a core reporting engine.
Stack fit. Laravel + Composer is a clean fit. Wrap the library in a single HtmlExcelExporter service (constructor-injected or bound as a singleton), expose it via a facade or a typed interface, and keep the library out of controllers and jobs. The wrapper buys you three things: a swap point if the library is abandoned, a place to sanitize input and neutralize formula injection, and a place to enforce size limits and timeouts.
Migration path. Do not adopt this if the application already uses PhpSpreadsheet—running both engines in one process is a size and conflict risk. If the app has no spreadsheet dependency yet, adoption is additive. If the goal is simply "export a Blade/HTML view to Excel," evaluate Laravel-native alternatives first: Maatwebsite Excel's FromView (Blade → sheet via HTML) is a closer stack fit and already carries Laravel integration; PhpSpreadsheet's built-in HTML reader also covers simple tables without adding a 75-star transitive dependency. Reserve this package for cases where its specific HTML handling (colspan, styles) demonstrably outperforms those alternatives.
Compatibility. Pin the version in composer.json and add a CI job that runs composer update --prefer-lowest and the app's PHP matrix. Confirm the package's PHP constraint against your Laravel version's minimum (Laravel 10/11 require PHP 8.1/8.2). If the package pins PHPExcel, verify it installs at all on PHP 8.2+.
Sequencing.
= + - @.Maintenance. Low effort day-to-day, but only because the package is small—not because it is well-supported. The real maintenance cost is the abandoned upstream: pinning the dependency, monitoring CVEs manually, and eventually forking or replacing it. With 75 stars and a single maintainer, plan for the package to go quiet. Budget a replacement spike inside 12 months; treat this as a tactical dependency, not a foundation.
Support. MIT, community-only, no SLA, no vendor. Internal ownership must be explicit—name a team or engineer responsible for the wrapper, the sanitization rules, and dependency upgrades. Do not let the wrapper become orphaned; it is the thing that makes the library replaceable.
Scaling. In-process, synchronous, memory-bound. PHPExcel-era engines approach ~1 KB per cell, so a 50k-row × 20-column export can plausibly breach a 256 MB PHP memory limit. Mitigations: hard row/column caps at the wrapper, run exports on a queue worker with its own memory limit and timeout, stream or chunk where the package permits, and return a signed download URL rather than holding the file in the request. Horizontal scaling is fine because the work is stateless—but each worker needs headroom.
Failure modes to instrument.
Allowed memory size errors.composer update → CI matrix catches this at PR time, not deploy time.=cmd, +1, -1, @SUM payloads.Ramp-up. Very low for a developer—half a day to read the API and produce a working export. The non-obvious work is the surrounding hardening (sanitization, limits, queueing, tests), roughly 3–5 dev days for a production-grade wrapper. Product and support ramp-up is negligible: no new UI, no new operational surface beyond a new job type and its failure alerts.
Recommendation. Accept as a tactical, wrapped, feature-flagged dependency for HTML-table-to-Excel conversion where Laravel-native options fall short. Reject as a strategic or high-volume reporting engine. The 2.46 score and 1.52 opportunity score are consistent with this: useful, but not a bet worth building on.
How can I help you explore Laravel packages today?