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
Url Highlight

Url Highlight Laravel Package

vstelmakh/url-highlight

View on GitHub
Deep Wiki
Context7

PHP library to find URLs in text and turn them into clickable links. Made to handle complex URLs, HTML markup and edge cases.

Frequently asked questions about Url Highlight
How do I install vstelmakh/url-highlight in a Laravel project?
Use Composer to install the package with `composer require vstelmakh/url-highlight`. The package is dependency-free and integrates directly into your Laravel application without requiring additional configuration.
Does this package support Laravel 10 and PHP 8.2?
Yes, vstelmakh/url-highlight is designed to work with modern Laravel versions (8+) and PHP 8.1+. Always check the package’s Composer requirements for the latest compatibility details.
Can I extract and highlight URLs from database fields or user-generated content?
Absolutely. The package is optimized for parsing URLs from any string input, including database fields, user comments, or API responses. It returns structured data for easy manipulation or display.
How accurate is URL detection compared to regex-based solutions?
The package uses a robust parsing algorithm that outperforms basic regex in handling edge cases like URLs with special characters, subdomains, or query parameters. It’s designed for reliability in production environments.
Is there a way to customize URL matching rules (e.g., exclude certain domains)?
Yes, the package allows you to configure allowed/blocked domains or URL patterns via its parser settings. This is useful for filtering out spammy links or internal-only URLs.
Will this package work with Laravel Blade templates for dynamic URL highlighting?
Yes, you can integrate the package into Blade templates by passing parsed strings to a helper or directive. For example, use `@highlightUrls($text)` to render highlighted links dynamically.
Are there performance concerns when parsing large texts (e.g., long articles)?
The package is optimized for efficiency and handles large texts without significant overhead. Benchmarking shows it scales well for typical Laravel use cases, including CMS or blog platforms.
Does vstelmakh/url-highlight support internationalized domain names (IDNs) like .中国?
Yes, the package natively supports IDNs and Unicode domains. It converts them to Punycode internally for compatibility while preserving the original display format.
Are there alternatives like this for Laravel, and why choose this one?
Alternatives include custom regex solutions or libraries like `symfony/ux-link-highlighter`, but vstelmakh/url-highlight stands out for its Laravel-native design, simplicity, and focus on accuracy without bloat.
How can I test URL parsing logic in my Laravel application?
Write unit tests using PHPUnit to verify parsing logic. The package’s output is structured (e.g., arrays of URL objects), making it easy to assert against expected results. Example: `assertEquals(['https://example.com'], $parser->parse($text));`
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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle