- How do I install phpoffice/phppresentation in a Laravel application?
- Install it with composer require phpoffice/phppresentation; no Laravel service provider is required. Pin an explicit version in composer.json and commit the lock file, treating the library as infrastructure. Wrap it in a PresentationBuilder or renderer service that owns temp paths and storage disk configuration.
- Is phpoffice/phppresentation compatible with Laravel 10, Laravel 11, and PHP 8.1+?
- PHPPresentation is framework-agnostic pure PHP with no Laravel coupling, so it fits Laravel 8+ and PHP 8.1+ cleanly. There is no service provider to register; you simply install it via Composer and wrap it in your own service. Confirm the library's current PHP support window before upgrading PHP, because your upgrade must be sequenced with a library bump.
- Can PHPPresentation read and write PowerPoint .pptx and ODF .odp files?
- PHPPresentation supports both reading and writing OOXML (.pptx) and ODF (.odp), but the two capabilities are not equally mature. Writing is far more mature than reading, and parsing arbitrary third-party .pptx files will surface unsupported constructs. Treat read support as a separate, higher-risk bet and test round-trip files carefully.
- How do I add slides, text, images, tables, and charts with PHPPresentation?
- The API is imperative: create a presentation, add slides, then add text, shapes, images, tables, and charts before handing it to a Writer. You can set metadata, fonts, and formatting on slides. This makes it suitable for template-driven report packs and exports, not pixel-perfect authoring.
- What PHP extensions does PHPPresentation require?
- PHPPresentation requires ext-zip and ext-xml, plus GD for image handling. Verify your runtime or container image satisfies these before deploying. Large decks also need memory and CPU headroom, so handle temp files and limits inside your adapter.
- Is LGPL v3 licensing a problem for a commercial Laravel product using PHPPresentation?
- The README explicitly states LGPL v3 even though repository metadata reports NOASSERTION, so get legal sign-off before shipping. For a proprietary product, using the unmodified library as a dynamically loaded Composer dependency is often acceptable, but that is not a call to make unilaterally. Forking or modifying the library changes the calculus materially.
- How do I generate PowerPoint decks from a queued Laravel job?
- Put generation in a queued job that writes the finished file to S3 or your storage disk, never inline in a web request. Define a PresentationRenderer contract that takes a view-model or DTO plus a template identifier and returns a file path. Keep PHPPresentation types out of domain code and handle temp files and memory limits inside the adapter.
- Does PHPPresentation support animations, transitions, SmartArt, and embedded OLE objects?
- Animations, transitions, SmartArt, embedded OLE objects, and some chart formatting are not supported and are silently degraded on round-trip. This creates a fidelity ceiling for complex marketing templates. Decks will open cleanly and look correct-ish, but do not expect pixel-identical reproduction.
- What should I use instead if PHPPresentation cannot match my PowerPoint template fidelity?
- If fidelity falls short, the common fallbacks are a paid SDK such as Aspose.Slides or a cloud API such as Google Slides. Keep PHPPresentation behind an internal contract so swapping renderers is an adapter change, not a refactor. Decide the fallback before committing to read-modify-write workflows.
- How do I test PHPPresentation output in a Laravel test suite?
- Test the adapter contract rather than internal library calls, and assert the generated file exists and is a valid zip archive. Unzip the .pptx and inspect slide XML for expected text and structure, or use snapshot comparisons for stable decks. Use Laravel's queue fakes to verify the job dispatches and writes to the expected disk.