misd/linkify
misd/linkify is a lightweight PHP library that converts plain-text URLs and email addresses into safe, clickable HTML links. It’s simple to configure and easy to integrate into Laravel or any PHP app to improve user-generated content.
http, https, mailto only — no javascript:, data:, file:).rel="nofollow noopener noreferrer", configurable target="_blank".TextLinkifier service rather than scattered regex helpers, Blade snippets, and overlapping libraries.Consider it (as reference, prototype, or vendored code) when:
attr, a callback that replaces the generated anchor) to add icons, tracking parameters, or wrapper markup without writing the matching logic yourself.Look elsewhere or build internally when:
rel/target policy, and lookalike/IDN awareness. Do not assume an unmaintained package handles this; the library deliberately escapes nothing.cakephp/utility text helpers), a maintained linkify fork, or a Markdown/autolink pipeline if you already render Markdown.Adoption gate before committing: confirm it installs under your Composer constraints, run its test suite on your target PHP, and diff its output against your escaping pipeline on representative payloads (URLs with trailing punctuation, parenthesized URLs, Unicode text, HTML entities, emails, and javascript:-style attacks). If either check is shaky, vendor the class into your own namespace and own it.
To executives: This is a tiny, MIT-licensed utility that turns bare URLs and email addresses in plain text into clickable links — a cheap UX polish item for our community, messaging, and support surfaces. There is no license cost and no strategic platform implication. The only real consideration is maintenance hygiene: the last release was 2017, has almost no downstream users, and has no security response. My recommendation is to adopt the capability, not the dependency — reuse an existing framework helper or vendor a small internal version we control. We get the user-facing benefit with no long-term support or supply-chain exposure, and the work fits inside an existing content epic at roughly a day of effort.
To engineering: One class, regex-based, zero runtime dependencies, permissive license, and no Laravel integration whatsoever — no provider, config, or Blade directive. Two concerns matter: it predates current PHP versions, and linkifying untrusted text is an XSS-adjacent operation (it also escapes nothing, so escaping order is on us). Recommendation: do not add it as a direct Composer dependency. Either use a maintained framework utility already in the stack, or fork/vendor the implementation behind an app-owned Linkifier::process(string $text): string service that (1) escapes before linking, (2) allow-lists http/https/mailto, (3) applies rel="nofollow noopener noreferrer" and a configurable target, and (4) has contract tests for trailing punctuation, parentheses, Unicode, HTML entities, and malicious payloads. Bind it as a singleton so policy is centralized, keep it out of hot paths with input size limits, roll it out behind a feature flag, and treat "keep vs. fork vs. replace" as a decision gate after a time-boxed spike. No migration, no ops impact.
One-line summary: Great behavior, stale package — take the idea, own the code, and keep the dependency graph clean.
How can I help you explore Laravel packages today?