superbuddy/bitly4laravel

Provides a Laravel package to communicate with Bit.ly API
27
Install
composer require superbuddy/bitly4laravel
Latest Version:v3.1.0
PHP:>=5.4
License:MIT
Last Updated:Aug 15, 2016
Links: GitHub  ·  Packagist
Maintainer: superbuddy

bitly4laravel

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Provides a Laravel package to communicate with Bit.ly API.

In order to use this package you need to get OAuth Generic Access Token from Bitly website.

Instalation

Warning this is v3 version of bitly4laravel package. If you want to use the old v2 version use the v2 branch.

Add bitly4laravel to your composer.json file.

require : {
    "jelovac/bitly4laravel": "3.*"
}

Or with composer command:

composer require "jelovac/bitly4laravel": "3.*"

Add provider to your app/config/app.php providers

'Jelovac\Bitly4laravel\Bitly4laravelServiceProvider',

Publish config

For Laravel 5 use:

php artisan vendor:publish

For Laravel 4 use:

php artisan config:publish jelovac/bitly4laravel

Optional (recommended)

Add alias to app/config/app.php aliases

'Bitly' => 'Jelovac\Bitly4laravel\Facades\Bitly4laravel',

Usage

Shorten links

Bitly::shorten('http://google.com/');

Response format: JSON

{
    "data": {
      "global_hash": "900913",
      "hash": "ze6poY",
      "long_url": "http://google.com/",
      "new_hash": 0,
      "url": "http://bit.ly/ze6poY"
    },
    "status_code": 200,
    "status_txt": "OK"
}

Expand links

Bitly::expand('http://bit.ly/ze6poY');

Response format: JSON

{
    "data": {
      "expand": [
        {
          "global_hash": "900913",
          "long_url": "http://google.com/",
          "short_url": "http://bit.ly/ze6poY",
          "user_hash": "ze6poY"
        }
      ]
    },
    "status_code": 200,
    "status_txt": "OK"
}

Repository

https://github.com/jelovac/bitly4laravel

License

The Bitly4laravel package is open-sourced software licensed under the MIT license

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

628,058,007 9,707
laravel/framework

The Laravel Framework.

576,155,700 34,907
laravel/tinker

Powerful REPL for the Laravel framework.

485,678,092 7,440