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
Embed Helpers

Embed Helpers Laravel Package

21torr/embed-helpers

A PHP/Symfony library for working with platforms that allow embedded content, such as video services. It provides reusable helpers to simplify common embed-related tasks, making it easier to integrate and handle embeddable content in your applications.

View on GitHub
Deep Wiki
Context7

A library that helps dealing with platform that allow embedding content (like video platforms)

Frequently asked questions about Embed Helpers
Is 21torr/embed-helpers a Laravel package or a Symfony bundle?
It is a Symfony bundle, published as 21TORR/EmbedHelpersBundle, not a Laravel package. It registers embed providers through Symfony's dependency injection tagging attributes, a bundle class, and a DI extension. Laravel does not boot Symfony bundles, so none of that wiring will activate automatically in a Laravel application. The underlying URL normalization, provider resolution, and VideoDetails DTO are framework-agnostic PHP you can reuse.
Can I install 21torr/embed-helpers in a Laravel app with composer require?
Yes, composer require 21torr/embed-helpers will resolve in a modern Laravel application because the PHP 8.3 requirement and Symfony 7/8 components it depends on are already satisfied transitively. However, nothing will auto-wire: there is no Laravel service provider, config file, or facade. In practice you either port the resolver into your own support classes or run it behind a Symfony microkernel, and the bridge approach is disproportionate for a URL mapper.
What does 21torr/embed-helpers actually do?
It takes a pasted URL, normalizes it, resolves it to a matching provider, and returns a VideoDetails DTO whose getEmbedUrl() method gives you a correctly formed embed URL. The scope is deliberately small: it is a pure URL-to-embed-URL mapper with roughly a few hundred lines of parsing and ID-extraction rules. It does not render players, fetch metadata, or store anything.
Which video platforms does 21torr/embed-helpers support?
The provider set is small and centered on YouTube, including the common variants such as watch URLs, youtu.be short links, /shorts/, /embed/, and youtube-nocookie. A limited number of other providers ship with the bundle, and the provider list is extensible through the same resolver interface. Before committing, list the providers your product actually needs and check how many are just YouTube URL shapes, because that determines whether extraction is trivial.
How do I port 21torr/embed-helpers from Symfony DI tags to Laravel?
Replace the Symfony bundle, DI extension, and provider tagging attributes with a Laravel service provider that binds a resolver and injects a config array of provider class-strings. Port the VideoDetails readonly DTO and the provider classes as-is, since they carry no framework dependency. In a typical app that means a small app/Support/Embeds directory, one config/embeds.php file, and a container binding, roughly one to two days of work. After that you own and maintain the code.
Which PHP and Laravel versions does 21torr/embed-helpers support?
The package requires PHP 8.3 or newer and Symfony 7 or 8 components, which lines up with Laravel 11 and 12 baselines. There is no explicit Laravel version constraint because Laravel integration is not supported upstream. Because the code is plain PHP once extracted, it will run on any Laravel version whose PHP floor matches.
Does 21torr/embed-helpers fetch video titles, thumbnails, or oEmbed metadata?
No. The package only maps a URL to an embed URL, with no oEmbed fetching, no title or thumbnail resolution, and no provider API calls. If your roadmap item is a rich video card with metadata, this library does not deliver it and you would need oEmbed support on top. If the requirement is simply turning a pasted link into a valid iframe, it covers that case.
Does 21torr/embed-helpers handle GDPR consent or CSP for embedded videos?
No. Privacy-friendly embedding via youtube-nocookie, click-to-load placeholders, and consent gating are product decisions the library does not make for you. Likewise, the Content-Security-Policy frame-src allowlist is yours to define and maintain per provider. Plan those behaviors explicitly, especially if the app serves EU users.
Is 21torr/embed-helpers safe when users submit their own embed URLs?
Treat it as a URL mapper, not a sanitizer. If embeds come from user-generated content, you must add your own allowlisting of providers and hosts, plus output escaping, because the library does not address spoofing or malicious URL input. Editorial-only embeds carry much lower risk. Also check for open redirects and verify the produced embed host before rendering it in an iframe.
What are the maintenance risks and alternatives to 21torr/embed-helpers?
The code risk is low but the upstream risk is real: zero stars and dependents, a single maintainer at one agency, best-effort support, and a young API that already had breaking changes such as videoType removal in 2.0.0 and the shorts-to-short rename. The metadata also shows a future-dated release, so verify the actual latest version on Packagist. For a framework-agnostic option with metadata support, embed/embed is the mature alternative; for a YouTube-only mapping, writing the parser yourself is a small, low-risk job.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums