Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Common Laravel Package

phpoffice/common

PHPOffice Common provides shared utility classes for PHPOffice projects, including XML helpers, drawing and font handling, file utilities, and compatibility code. It supports libraries such as PhpSpreadsheet and PHPWord.

View on GitHub
Deep Wiki
Context7

Shared components between all PHPOffice projects

Frequently asked questions about Common
What is phpoffice/common used for in a Laravel app?
It is a low-level shared utility library used beneath PHPOffice packages such as PhpSpreadsheet and PHPWord. It provides XML and stream helpers, OLE compound-document reading and writing, drawing primitives, font handling, and file utilities. In Laravel it is usually pulled in transitively when you install a document-processing package, not used directly.
Do I need to install phpoffice/common separately in Laravel?
Usually no. Composer installs it automatically as a dependency of phpspreadsheet or phpword. You only need composer require phpoffice/common if you are building directly against its utility classes. Most Laravel teams should manage it through the parent package and lockfile.
Is phpoffice/common a Laravel package with a service provider?
No. It is framework-agnostic PHP utility code and does not ship a Laravel service provider, facade, config file, migrations, or routes. There is nothing to register in config/app.php or bootstrap/providers.php. Treat it as a platform dependency for document processing rather than an application component.
Which PHP versions does phpoffice/common support?
The package is a Composer library with broad PHP support, and release 1.1.0 adds PHP 8.5 to its CI matrix. That CI coverage only confirms the package itself builds on 8.5; it does not guarantee PhpSpreadsheet, PHPWord, or required extensions like zip, xml, and gd are ready. Check your full dependency stack before upgrading PHP.
Does phpoffice/common work with Laravel 10, 11, or 12?
Laravel version is largely irrelevant because the package has no framework integration. It works wherever Composer can install it and the parent PHPOffice package supports your PHP version. Validate through the package that actually uses it, such as PhpSpreadsheet or PHPWord, rather than through a Laravel version constraint.
What is new in phpoffice/common 1.1.0?
The main runtime addition is OLEWrite, the write-side counterpart to the existing OLERead class, which allows OLE compound-document containers to be written. The release also adds PHP 8.5 to CI, allows PHPStan 2.x, and raises PHPStan to level 7. There are no breaking changes, deprecations, or removed symbols in this bump.
Is upgrading phpoffice/common from 1.0.5 to 1.1.0 safe?
The release is additive and should be low risk for most applications because it does not remove or break existing APIs. The main caution is new OLE writing code, which is unproven in production and should be treated as beta if you adopt it. Review your lockfile diff because the update often arrives silently through PhpSpreadsheet or PHPWord.
Should I use OLEWrite in production?
Only if your roadmap needs legacy OLE container writing, such as .xls, .doc, or .ppt style output. OLEWrite is new, contributed by a first-time contributor, and has little production mileage, so binary corruption risk is real but hard to detect in logs. Use a golden-file corpus with byte- or structure-level assertions before relying on it.
How should I test document output when using phpoffice/common?
Do not rely only on 'opens without exception' checks for binary output. Add golden-file comparisons or structural assertions for generated OLE containers and spreadsheet files, and cover read and write paths separately. If you do not use OLEWrite, focus regression tests on the parent packages that consume the library.
Is phpoffice/common maintained and does it use static analysis?
Yes, the 1.1.0 release shows active maintenance through CI updates and static-analysis tightening. It adds PHP 8.5 to the CI matrix, permits PHPStan 2.x, and raises PHPStan to level 7. Those changes are development-time signals and do not alter runtime behavior for consumers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource