kylewm/brevity
Brevity is a URL shortener for Laravel: create short links, redirect visitors, and track hits. It offers a simple, self-hosted alternative to third-party services, with configurable length and custom slugs.
app/Support/Text/PostTruncator with zero legal review or attribution obligations — which is arguably its most valuable property. Recommended decision: port it behind an application-owned interface.src/.Consider it when:
mbstring present, PHP version verified against the target Laravel runtime, an internal interface in front of it, and contract tests for Unicode, emoji, combining characters, URLs, mentions, hashtags, and HTML-stripped input.Look elsewhere (or budget a real build) when:
For executives (30 seconds): This is a small, free (CC0-licensed) utility for trimming text to fit character limits — relevant to sharing, previews, and notification surfaces. It is not strategic and nothing on the roadmap depends on it. Recommended action: port the logic into our codebase rather than taking it as a dependency. Cost is roughly a day including tests; there is no vendor lock-in, no licensing exposure, and no adoption risk because we own the copy. The one decision I need is whether we are committing to approximate truncation (previews) or exact platform-aware character counting (publishing) — the latter is a separate, larger piece of work.
For engineering (the ask):
PostTruncator contract with explicit length, URL, and ellipsis semantics; keep the vendor call or the ported copy as an implementation detail. No controllers, models, jobs, or Blade templates should reference it directly.app/Support/ → contract tests on expected output → integrate first in a low-risk path (previews, admin tooling) → compare against current Str::limit/substr behavior → expand to publishing paths only after validation.strip_tags() before shortening; a final hard Str::limit() belt-and-braces check before any API call; log input/output lengths when debugging; never shorten an already-shortened string without expecting a double ellipsis.How can I help you explore Laravel packages today?