jeffersongoncalves/laravel-dub
A Laravel integration for the Dub.co link management API that lets you create, update, and organize short links and retrieve click analytics directly from your PHP application using a clean, fluent interface. Simplify branded link sharing and tracking.
bulkCreateLinks supports campaign/batch workflows; listLinks/getLink/updateLink/deleteLink cover CRUD lifecycle management for an admin link-management screen.DUB_API_KEY, DUB_API_URL, DUB_TIMEOUT), it slots into a Laravel service with near-zero setup — suitable for a spike/MVP. It does not cover webhooks/events, custom domains, tags, or QR codes in this release, so roadmap items depending on those must be deferred or built against the raw API.DubRateLimitException honoring Retry-After) means the PM can plan for graceful degradation and queueing rather than assuming unlimited throughput — relevant for high-volume bulk operations and campaign launches.Adopt when:
DubRateLimitException.Look elsewhere (or plan to wrap/extend) when:
DUB_API_URL is configurable, so self-hosted may work, but it's untested/unsupported here).listLinks behavior at scale should be validated.To executives: We can add branded short links, campaign tracking, and basic click analytics to our product without building or maintaining that infrastructure ourselves. This package is a small, config-only integration to a proven link platform (Dub.co) — days of work, not a quarter, and no new servers to run. It keeps us on the "buy" side of build-vs-buy for undifferentiated plumbing and lets the team focus on product. Main trade-off: we take on a vendor dependency and are bounded by their rate limits and feature set (no webhooks/QR/custom-domain management in this release).
To engineering: Thin static PHP client over Dub's REST API covering link CRUD, bulk create, and aggregate analytics, with typed rate-limit exceptions that respect Retry-After. Zero-config via environment variables. Caveats to plan around: static calls hurt mockability — wrap it behind an interface/facade we control and use Laravel's HTTP fake in tests; error handling beyond 429 is thin, so add a resilient wrapper with retry/queueing for bulk and launch-critical paths; confirm pagination and self-hosted-URL behavior before depending on them. Treat it as an adapter to isolate, not a deep architectural commitment.
How can I help you explore Laravel packages today?