- Is machy8/macdom a Laravel package?
- No, machy8/macdom is a standalone PHP HTML preprocessor that wraps DOMDocument with a fluent, macro-friendly API. It does not provide Laravel service providers, facades, configuration publishing, or Blade integration. You can install it with Composer, but using it in Laravel requires a thin internal adapter or build script.
- How do I install machy8/macdom in a Laravel project?
- Install it through Composer and pin the exact package version, or a commit hash if possible, because the last release was in 2017. There is no Laravel auto-discovery or framework integration to configure. Keep it behind an internal interface or Artisan command rather than calling it directly from application code.
- What PHP and Laravel versions does Macdom support?
- The provided metadata does not document a supported PHP or Laravel version matrix, and the last release date of 2017 makes PHP 8.x compatibility a real concern. Check the package composer.json platform requirements and run a compatibility spike against your target Laravel and PHP versions. If PHP 8 compatibility fails, plan to fork and patch or choose another approach.
- Can I use Macdom instead of Blade for runtime templating?
- You should not use Macdom as a replacement for Blade on normal Laravel application pages. It does not fit Laravel request lifecycle, view rendering, middleware, or caching abstractions, and running two templating models creates separate escaping, testing, caching, and ownership concerns. Reserve it for isolated build-time or offline HTML transformation if you adopt it at all.
- What is Macdom actually used for?
- Macdom is an HTML preprocessor that provides a fluent API over PHP DOMDocument for querying, traversing, and modifying HTML or XML documents. It is best suited to build-time transforms for static, marketing, or email-like assets. It is not designed as a runtime Laravel view engine or a general Blade replacement.
- Is Macdom safe for processing untrusted user HTML?
- There is no evidence of an upstream security response process, and HTML parsing plus escaping edge cases can create real risk if untrusted content is processed. Do not treat Macdom as a sanitizer or rely on it for user-generated HTML without a separate security review. For production use, isolate it to trusted build-time inputs and test malformed HTML and escaping behavior.
- Is machy8/macdom still maintained?
- The package had its last release on 2017-10-08, has around 11 stars, a low health score, and unclear repository provenance in the supplied metadata. That signals weak maintenance and likely compatibility drift with modern PHP and Laravel. Adoption should include a funded fork-and-own plan and a clear exit strategy.
- How should I test Macdom output in CI?
- Use golden-file tests that compare rendered HTML against known-good fixtures, plus unit tests for escaping, malformed HTML, and output determinism. Add static analysis and pin the exact Macdom version or commit in CI. Canary one non-critical static page or asset set before expanding usage.
- Can Macdom output be cached in Laravel?
- Yes, but only if Macdom runs as a build-time step that writes compiled HTML to public/build or storage for Laravel or a CDN to serve. Do not run Macdom per request in the normal runtime path. Define deterministic cache invalidation tied to source template and package version changes.
- What are alternatives to Macdom for Laravel HTML transformation?
- Blade components are the default choice for Laravel runtime templating, while Twig, Latte, or a small internal preprocessor may fit offline build-time needs. If you need Macdom's specific DOM manipulation capability, wrap it behind an HtmlPreprocessor interface so it can be replaced. If a proof of concept shows no clear benefit, retire it rather than making it a strategic dependency.