All Projects → Shivella → laravel-bitly

Shivella / laravel-bitly

Licence: MIT license
Laravel package for generating bitly url

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-bitly

ShortURL-Services-List
A list of 600+ URL shorteners (i.e goo.gl, bit.ly)
Stars: ✭ 32 (-55.56%)
Mutual labels:  url-shortener, bitly
gShort
URL Shortener without all the crap
Stars: ✭ 80 (+11.11%)
Mutual labels:  url-shortener, bitly
YOURLS
🔗 The de facto standard self hosted URL shortener in PHP
Stars: ✭ 9,007 (+12409.72%)
Mutual labels:  url-shortener, bitly
bitlyshortener
High-volume Bitly V4 URL shortener with in-memory cache
Stars: ✭ 20 (-72.22%)
Mutual labels:  url-shortener, bitly
Dogbin
The sexiest pastebin and url shortener ever
Stars: ✭ 237 (+229.17%)
Mutual labels:  url-shortener
Fossurl
Your Own Url Shortner Without any fancy server side processing and support for custom url , which can even be hosted on GitHub Pages
Stars: ✭ 131 (+81.94%)
Mutual labels:  url-shortener
Filite
A simple, light and standalone pastebin, URL shortener and file-sharing service
Stars: ✭ 125 (+73.61%)
Mutual labels:  url-shortener
Prestashop Clean Urls
Prestashop module. This override module allows to remove IDs from URLs
Stars: ✭ 87 (+20.83%)
Mutual labels:  url-shortener
Perfect-URL-Shortener
An Example URL Shortener System for Perfect
Stars: ✭ 37 (-48.61%)
Mutual labels:  url-shortener
Sharex
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
Stars: ✭ 18,143 (+25098.61%)
Mutual labels:  url-shortener
Sharex Upload Server
AKA ShareS - Feature full & Stable ShareX and file server in node. Includes images, videos, code, text, markdown rendering, password protected uploads, logging via discord, administration through Discord, url shortening, and a full front end. Use standalone or via reverse proxy
Stars: ✭ 180 (+150%)
Mutual labels:  url-shortener
Serverless Url Shortener
URL shortener for AWS Lambda and S3
Stars: ✭ 146 (+102.78%)
Mutual labels:  url-shortener
Golang Url Shortener
URL Shortener written in Golang using Bolt DB or Redis. Provides features such as Deletion, Expiration, OAuth and is of course Dockerizable.
Stars: ✭ 240 (+233.33%)
Mutual labels:  url-shortener
Laravel Short Url
A Laravel package to shorten urls
Stars: ✭ 127 (+76.39%)
Mutual labels:  url-shortener
keeplinkin
🔗 A Flask and Redis based fast, feature rich and free URL shortener site.
Stars: ✭ 21 (-70.83%)
Mutual labels:  url-shortener
Sheets Url Shortener
A simple short URL redirect service built on top of Google Sheets, and runs for cheap on Google Cloud Run serverless.
Stars: ✭ 89 (+23.61%)
Mutual labels:  url-shortener
Node Bitly
A Bit.ly library for node.js - This project is looking for a new maintainer
Stars: ✭ 167 (+131.94%)
Mutual labels:  url-shortener
Azurlshortener
An simple and easy Url Shortener
Stars: ✭ 247 (+243.06%)
Mutual labels:  url-shortener
Shorty
A simple URL shortener for PHP
Stars: ✭ 156 (+116.67%)
Mutual labels:  url-shortener
Urlshorting
A simple but powerful URL shortener
Stars: ✭ 150 (+108.33%)
Mutual labels:  url-shortener

Laravel Bitly Package

A laravel package for generating Bitly short URLs.

For more information see Bitly

Build Status Latest Stable Version License Total Downloads

Requirements

Laravel 5.1 or later

Installation

Installation is a quick 3 step process:

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

Step 1: Download laravel-bitly using composer

Add shivella/laravel-bitly by running the command:

composer require shivella/laravel-bitly

Step 2: Enable the package in app.php

Register the Service in: config/app.php

Shivella\Bitly\BitlyServiceProvider::class,

Step 3: Configure Bitly credentials

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

Add this in you .env file

BITLY_ACCESS_TOKEN=your_secret_bitly_access_token

Step 4 (Optional): Configure the package facade

Register the Bitly Facade in: config/app.php

<?php

return [
    'aliases' => [

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

Usage

<?php

$url = app('bitly')->getUrl('https://www.google.com/'); // http://bit.ly/nHcn3

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

<?php

use Bitly;

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

<?php

$url = Bitly::getUrl('https://www.google.com/'); // http://bit.ly/nHcn3

Testing

In your unit tests you may use BitlyClientFake class instead of regular client. It will create a fake short URLs using hashing without calling an external REST API, which will speed up your unit tests. Fake might be setup via DI at your \Tests\TestCase::createApplication() implementation:

<?php

namespace Tests;

use Illuminate\Contracts\Console\Kernel;
use Shivella\Bitly\Testing\BitlyClientFake;

trait CreatesApplication
{
    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        $app = require __DIR__.'/../bootstrap/app.php';

        $app->make(Kernel::class)->bootstrap();

        // swap Bitly client by a fake
        $app->singleton('bitly', function () {
            return new BitlyClientFake();
        });

        return $app;
    }
}

As an alternative you may use \Shivella\Bitly\Facade\Bitly::fake() method to swap regular client by a fake.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].