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
Laravel Bitly

Laravel Bitly Laravel Package

shivella/laravel-bitly

Laravel Bitly is a simple wrapper for the Bitly API that lets Laravel apps shorten URLs using a clean facade. Configure your Bitly token, generate short links, and integrate URL shortening into your projects quickly.

View on GitHub
Deep Wiki
Context7

Laravel package for generating bitly url

Frequently asked questions about Laravel Bitly
How do I install and configure shivella/laravel-bitly in a Laravel app?
Install it with composer require shivella/laravel-bitly, publish the package config with php artisan vendor:publish, and add BITLY_ACCESS_TOKEN to your .env file. The service provider and facade are auto-discovered on modern Laravel, so no manual registration is usually required. There are no migrations, queues, or schema changes to run, which keeps setup to a few minutes.
Which Laravel and PHP versions does laravel-bitly support?
The package is a thin wrapper over the Bitly v4 REST API and is used in conventional Laravel 8-11 / PHP 8.x applications. Because it depends on illuminate/support and an HTTP client such as Guzzle, confirm the declared constraints in its composer.json against your own lockfile before upgrading. Check the repository's CI matrix to see which versions are actually tested rather than only declared.
How do I shorten a URL with the Bitly facade in Laravel?
Resolve the facade and pass the long URL you want to shorten, for example Bitly::shorten('https://example.com/long-path'); the README documents the exact method signature and return shape. The access token and any options come from the published config file backed by BITLY_ACCESS_TOKEN. Wrap the call in your own small service class so the rest of the codebase never depends on the facade directly.
How does laravel-bitly handle errors and non-2xx Bitly responses?
Because it is a thin adapter, failures generally surface as HTTP client exceptions or a generic error rather than a rich typed exception hierarchy. Inspect the response status and branch on 400, 403, 429, and 5xx yourself, then normalize them into your own exception types. That wrapper is also the right place to add logging, metrics, and user-friendly fallbacks.
Does laravel-bitly handle Bitly rate limits and retries automatically?
No. Retry, backoff, 429 handling, timeout configuration, and circuit breaking are not built in, so those concerns fall to the integrating team. Set an explicit timeout on the underlying HTTP client and add bounded retries with exponential backoff only for idempotent failures. Treat quota exhaustion as a business-level fallback rather than an infinite retry loop.
Where should I store the Bitly access token and how do I rotate it?
Keep the token in environment config or a secret manager, never in the published config file or version control. Scope it to the least-privileged Bitly account or group you can, since the package offers no fine-grained permission model itself. Rotation is manual: update the env var, clear cached config, and redeploy, and use a dedicated staging Bitly group so test links do not pollute production analytics.
Should I shorten URLs synchronously in a request or queue the Bitly call?
A synchronous outbound HTTPS call adds latency and a hard runtime dependency on Bitly being available and under quota. Queue the shortening job, or cache links that are shortened repeatedly, and define a graceful fallback such as returning the long URL when Bitly fails. Never let a shortener outage fail a critical path like sending a transactional email or notification.
Can I use a custom short domain or Bitly group with this package?
The package passes your request to the Bitly v4 shorten endpoint, so support for group GUIDs and custom domains depends on what the wrapper exposes as configuration. Verify in the source whether those parameters are forwarded or whether the default group's domain is used implicitly. If they are not exposed, extend the adapter rather than patching product code.
Does laravel-bitly support shortening multiple URLs in a single request?
There is no documented bulk interface in the package, so plan on one HTTP call per URL unless you extend it. For more than a handful of links, loop with a concurrency limit, respect Bitly rate limits, and consider calling Bitly's own bulk endpoints directly. Run bulk work inside queued jobs with instrumentation so partial failures are visible and retryable.
What are the alternatives to laravel-bitly, and is it still maintained?
Alternatives include calling the Bitly v4 API directly, using Rebrandly or another shortener, running a custom short domain yourself, or defining a provider-agnostic interface with one implementation per provider. shivella/laravel-bitly had a February 2025 release, but with a single maintainer and a small star count you should treat it as a convenience wrapper rather than a support contract. Defining an internal LinkShortener interface keeps the facade as one swappable implementation.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core