numenklatur/google-short-url

6,505 1
Install
composer require numenklatur/google-short-url
Latest Version:1.0
PHP:>=5.4.0
Last Updated:Apr 29, 2015
Links: GitHub  ·  Packagist
Maintainer: arthurnumen

googleShortUrl

Provides a Laravel package to communicate with Google Short Url API.

Instalation

Add googleShorUrl to your composer.json file.

require : {
    "numenklatur/google-short-url": "1.0"
}

Or with composer command:

composer require "numenklatur/google-short-url": "1.0"

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

'NumenKlatur\GoogleShortUrl\GoogleShortUrlServiceProvider',

Publish config

For Laravel 4 use:

php artisan config:publish numenklatur/google-short-url

Add alias to app/config/app.php aliases

'ShortUrl' => 'NumenKlatur\GoogleShortUrl\Facades\GoogleShortUrlApi',

Usage

Shorten links

ShortUrl::shorten('http://numenklatur.me/');

Response format: JSON

{
  "kind": "urlshortener#url",
  "id": "http://goo.gl/xa55D2",
  "longUrl": "http://numenklatur.me/"
}

Expand links

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

Response format: JSON

{
  "kind": "urlshortener#url",
  "id": "http://goo.gl/xa55D2",
  "longUrl": "http://numenklatur.me/",
  "status": "OK"
}

Related Packages

doctrine/dbal

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

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658