PHPackages                             kalprajsolutions/bitly - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kalprajsolutions/bitly

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kalprajsolutions/bitly
======================

Laravel package for generating bitly url

1.2(1y ago)27MITPHPPHP &gt;=7.1

Since Mar 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kalprajsolutions/bitly)[ Packagist](https://packagist.org/packages/kalprajsolutions/bitly)[ RSS](/packages/kalprajsolutions-bitly/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Laravel Bitly Advanced Package
==============================

[](#laravel-bitly-advanced-package)

A laravel package for generating [Bitly](https://bitly.com/) advanced short URLs and BITLINKS.

Bitly is the most widely trusted link management platform in the world. By using the Bitly API, you will exercise the full power of your links through automated link customization, mobile deep linking, and click analytics.

For more information see [BITLY DEV DOCS](https://dev.bitly.com/)

[![Latest Stable Version](https://camo.githubusercontent.com/6f4b44ddaac1142eb039f3a946512f110f8b02dca04f1b08ad28a31b4abf5da2/68747470733a2f2f706f7365722e707567782e6f72672f6b616c7072616a736f6c7574696f6e732f6269746c792f762f737461626c65)](https://packagist.org/packages/kalprajsolutions/bitly)[![License](https://camo.githubusercontent.com/a0e7299816952f62450bec817de471fd72a9194214bdb3fdd50f8e92e3786a43/68747470733a2f2f706f7365722e707567782e6f72672f6b616c7072616a736f6c7574696f6e732f6269746c792f6c6963656e7365)](https://packagist.org/packages/kalprajsolutions/bitly)[![Total Downloads](https://camo.githubusercontent.com/29549db1d75c5bab9d54f34f042924fc352bd4620517dd992930bb90c3651d76/68747470733a2f2f706f7365722e707567782e6f72672f6b616c7072616a736f6c7574696f6e732f6269746c792f646f776e6c6f616473)](https://packagist.org/packages/kalprajsolutions/bitly)

Requirements
------------

[](#requirements)

Laravel 5.1 or Later

PHP 7.1 or Later

Bitly [Access Token](https://app.bitly.com/settings/api/ "Access Token")

Installation
------------

[](#installation)

Installation is a quick 3 step process:

1. Download kalprajsolutions/bitly using composer
2. Enable the package in app.php
3. Configure your Bitly credentials
4. (Optional) Configure the package facade

### Step 1: Download kalprajsolutions/bitly using composer

[](#step-1-download-kalprajsolutionsbitly-using-composer)

Add **kalprajsolutions/bitly** by executing the command:

```
composer require kalprajsolutions/bitly

```

### Step 2: Enable the package in app.php

[](#step-2-enable-the-package-in-appphp)

Register the Service in: **config/app.php**

```
KalprajSolutions\Bitly\BitlyServiceProvider::class,
```

### Step 3: Configure Bitly credentials

[](#step-3-configure-bitly-credentials)

```
php artisan vendor:publish --provider="KalprajSolutions\Bitly\BitlyServiceProvider"

```

Add this in you **.env** file

```
BITLY_ACCESS_TOKEN=your_secret_bitly_access_token

```

### Step 4 (Optional): Configure the package facade

[](#step-4-optional-configure-the-package-facade)

Register the Bitly Facade in: **config/app.php**

```
return [

    'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        // ...
        'Bitly' => KalprajSolutions\Bitly\Facade\Bitly::class,
    ],

];
```

Quick Usage
-----------

[](#quick-usage)

```
$url = app('bitly')->short('https://www.example.com/'); // http://bit.ly/abcdefg
```

Or if you want to use facade, add this in your class after namespace declaration:

```
use Bitly;
```

Then you can use it directly by calling `Bitly::` like:

```
$url = Bitly::short('https://www.example.com/'); // http://bit.ly/abcdefg
```

In quick usage you can also use Proxy to short the url asap using `->proxy()`

```
$url = Bitly::proxy('user:pass@1.1.1.1:80')->short('https://www.example.com/'); // http://bit.ly/abcdefg
```

Advance Usage
-------------

[](#advance-usage)

This Bitly package allow you to use advance bitlink attributes to customize bitly urls and proxies.

#### Guarding Attributes

[](#guarding-attributes)

> Note: While using attribues you will have to provide `->url()` and `->get()` to retrive short url!

**URL**

You will have to provide long URL to this function which will be used to shorten the url.

```
$url = Bitly::url('http://example.com')->get(); // http://bit.ly/nHcn3
```

**TITLE**

Its a short description that appears in the Bitly UI. You can now set the title of the URL which you are shortning by passing title in title function

```
$url = Bitly::url('http://example.com')
		->title('This will be the title')
		->get();
```

**PROXY**

Pass an associative array to specify HTTP proxies for specific URI schemes (i.e., "http", "https"). Provide a no key value pair to provide a list of host names that should not be proxied to.

> Note: You can provide proxy URLs that contain a scheme, username, and password. For example, "".

```
$url = Bitly::url('http://example.com')
		->proxy('user:pass@localhost:8125')
		->get();
```

OR

```
$url = Bitly::url('http://example.com')
		->proxy([
			'http'  => 'http://localhost:8125', // Use this proxy with "http"
			'https' => 'http://localhost:9124', // Use this proxy with "https"
		])
		->get();
```

**TAGS**

Set multiple tags with tags attributes. Tags must be provided in array.

```
$url = Bitly::url('http://example.com')
		->tags([
		'First Tag',
		'Second Tag',
		])->get();
```

**GUID**

guid can be used to set your group id. GUID Identifies a group of users in your account. Every user will belong to at least one group within an organization. Most actions on our API will be on behalf of a group. Always verify your default group in Bitly and specify a group in the call with `->guid()` attribute.

```
$url = Bitly::url('http://example.com')
		->guid('Ba1bc23dE4F')
		->get();
```

**DOMAIN**

Customizing the domain requires that you have a custom domain attached to your Bitly account. The default value is bit.ly. To brand your short links use domain attribute. Premium Bitly customers can set custom domain added in dashboard with `->domain()` . This is only for Premium Bitly Customers

```
$url = Bitly::url('http://example.com')
		->domain('custom.com')
		->get();
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~844 days

Total

2

Last Release

724d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0ae2d708bbc168482ce80b191cdd557ad7ccff3146020b07feabe1a96346229?d=identicon)[kalprajsolutions](/maintainers/kalprajsolutions)

---

Top Contributors

[![Pushkraj19](https://avatars.githubusercontent.com/u/29335514?v=4)](https://github.com/Pushkraj19 "Pushkraj19 (7 commits)")

---

Tags

bitlybitly-apibitly-clientbitly-v4kalprajsolutions-bitlylaravellaravel-bitlyurl-shortenerurl-shortnerurllaravellinkpackagebitlyshort

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kalprajsolutions-bitly/health.svg)

```
[![Health](https://phpackages.com/badges/kalprajsolutions-bitly/health.svg)](https://phpackages.com/packages/kalprajsolutions-bitly)
```

###  Alternatives

[shivella/laravel-bitly

Laravel package for generating bitly url

75867.0k1](/packages/shivella-laravel-bitly)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
