Weave Code
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

Php Dom Manipulations Laravel Package

24hoursmedia/php-dom-manipulations

Lightweight PHP helpers for manipulating HTML DOM documents. Create, find, update, replace, and remove nodes and attributes with a simple API suited for scraping, templating, and HTML cleanup tasks in legacy or modern PHP projects.

View on GitHub
Deep Wiki
Context7

php-dom-manipulations

A library to manipulate dom.

Manipulators

GaAddCampaignToLinks

Add google analytics campaign information to all links in a document.

Usage:

$html = '<a href="test.html">a</a><a href="test2.html">a</a><a href="#test">c</a>';
$doc = new \DOMDocument();
$doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$m = new \T4\DomManipulations\Manipulator\Ga\GaAddCampaignToLinks();
// source, medium, campaign
$m->modify($doc, 'newsletter-week14', 'email', 'spring');
$newHtml = $doc->saveHTML();

// $newHtml:
// <a href="test.html" utm_source="newsletter-week14" utm_medium="email" utm_campaign="spring">a</a><a href="test2.html" utm_source="newsletter-week14" utm_medium="email" utm_campaign="spring">a</a><a href="#test">c</a>
        
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor