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
Link Preview

Link Preview Laravel Package

dusterio/link-preview

A Laravel package for generating rich link previews from URLs. It extracts Open Graph and page metadata such as title, description, and image, letting you render Facebook-style link cards in your application.

View on GitHub
Deep Wiki
Context7

Link preview generator for PHP with Laravel support

Frequently asked questions about Link Preview
What does dusterio/link-preview do and how does it fit into a Laravel app?
It generates rich link previews from URLs by extracting Open Graph and page metadata such as title, description, and image, so you can render Facebook-style link cards. In Laravel it is expected to integrate via Composer with a service provider and config, making outbound HTTP calls to fetched pages. Treat it as a bounded feature accelerator behind your own service or action layer rather than a core content-ingestion or security-boundary fetcher.
Which Laravel and PHP versions does dusterio/link-preview support?
The last release was March 2022, so do not assume support for Laravel 10 or 11. Check the package's Composer constraints for PHP, Laravel, Guzzle, and Symfony dependency ranges, and validate the target matrix in CI or staging. If current-version compatibility fails, pin an older stack only if acceptable or plan to fork the minimal parsing code.
Is dusterio/link-preview safe for fetching user-supplied URLs?
Server-side URL fetching carries SSRF risk, including redirects to private networks, DNS rebinding, unbounded response sizes, and missing timeouts. The evaluation does not confirm that the package enforces network safety controls, so assess and add allow/deny policies, URL normalization, rate limits, and response limits. Never expose it directly to untrusted user URLs without hardening and observability.
Should I run link preview generation in a Laravel queue job?
Yes. Outbound scraping is latency- and resource-intensive, so run preview generation in a queued job rather than inline in request/response paths. Cache normalized preview payloads in Redis or the database with a TTL, deduplicate in-flight requests, and cap response size and timeouts. Keep the controller thin and invoke an application-owned LinkPreviewService contract.
How does dusterio/link-preview handle images — does it download or hotlink them?
The package extracts Open Graph image metadata, but the evaluation flags image handling and remote image proxying as items to validate. For production, avoid blindly hotlinking untrusted remote images; proxy or download thumbnails into object storage with size and type limits, then render escaped URLs. Confirm whether the package downloads images or only returns metadata before relying on it.
Does dusterio/link-preview include caching for generated previews?
Do not assume built-in caching; the technical evaluation lists caching behavior as something to validate. In production, cache normalized preview payloads by URL with a TTL in Redis or the database, and deduplicate concurrent requests for the same URL. This reduces outbound requests, controls operating cost, and improves latency for repeated links.
How do I install and configure dusterio/link-preview with Composer?
Install it with Composer, pin the package version, and commit the lockfile so dependency resolution is reproducible. Expect a Laravel service provider and configuration for outbound HTTP behavior, but verify auto-discovery, Guzzle/Symfony constraints, and queue behavior against your target PHP and Laravel versions. A short proof of concept should cover redirects, non-HTML responses, malformed pages, and private-address targets.
What are the XSS and sanitization concerns when rendering scraped link previews?
Scraped metadata is untrusted, so escape title, description, and URLs when rendering and never inject scraped HTML raw into Blade. Sanitize any HTML fragments and treat image URLs and attributes as hostile input. Rendering scraped metadata without escaping or sanitization creates XSS risk, so make escaping part of your preview contract and tests.
Is dusterio/link-preview actively maintained, and does it have tests and CI?
Expect low upstream activity: the last release was March 2022 and the community is small. Verify whether tests and CI are present, and plan for internal ownership, dependency monitoring, security patching, and possibly a maintained fork. MIT licensing is favorable, but stale dependencies may require forced upgrades or replacement.
What alternatives or migration path should I use if dusterio/link-preview is incompatible with Laravel 10 or 11?
Avoid coupling controllers or Blade templates directly to the package; wrap it in an internal LinkPreviewService interface so it can be replaced later. If it is incompatible with Laravel 10 or 11, use it as a reference implementation, fork the minimal parsing and fetching code under MIT, or replace it with a custom scraper. Pin the version and keep the adapter boundary so migration does not ripple through the application.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections