2017 © Pedro Peláez
 

library shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

image

tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  • Tuesday, October 3, 2017
  • by kazimahmed
  • Repository
  • 2 Watchers
  • 3 Stars
  • 2,307 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 22 % Grown

The README.md

Shorten Url

Latest Version on Packagist ![Software License][ico-license] Scrutinizer Code Quality Quality Score ![Total Downloads][ico-downloads], (*1)

Package for Shortening URL and Expanding URL with Google. This is a great combination if you plan to send Links in your Text Messages fired from your Application., (*2)

Install

Via Composer, (*3)

``` bash $ composer require tzsk/shorten-url, (*4)



## Configure First add the Service Provider and Facade in your app config file. ``` php 'providers' => [ ... Tzsk\ShortenUrl\Provider\ShortenUrlServiceProvider::class, ... ] ... 'aliases' => [ ... 'GoogleUrl' => Tzsk\ShortenUrl\Facade\GoogleUrl::class, ... ]

After that run vendor:publish with flag config:, (*5)

$ php artisan vendor:publish --tag=config

Once you do that you will have a new file in your config folder. config/url.php, (*6)

There is only one criteria. Google API key for Shortening URL. Just login with google account and go to [https://console.developers.google.com], (*7)

Now create a new Application there. And Enable API for URL Shortening. And generate API Key to use in Credentials section., (*8)

Usage

``` php, (*9)

Use Class Path at the top of the File.

use Tzsk\ShortenUrl\Facade\GoogleUrl;, (*10)

Inside your Controller Method for Shortening.

$short = GoogleUrl::shorten("LONG URL"); # Returns String., (*11)

OR...

$short_data = GoogleUrl::extended()->shorten("LONG URL"); /** * For extended it will give the full response that google provides. */, (*12)

Inside your Controller Method for Expanding.

$long = GoogleUrl::expand("SHORT URL"); # Returns String., (*13)

OR...

$long_data = GoogleUrl::extended()->expand("SHORT URL"); /** * For extended it will give the full response that google provides. */ ```, (*14)

Change log

Please see CHANGELOG for more information on what has changed recently., (*15)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*16)

Security

If you discover any security related issues, please email mailtokmahmed@gmail.com instead of using the issue tracker., (*17)

Credits

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

03/10 2017

dev-master

9999999-dev https://github.com/tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  Sources   Download

MIT

The Requires

 

The Development Requires

tzsk shorten-url

03/10 2017

1.0.3

1.0.3.0 https://github.com/tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  Sources   Download

MIT

The Requires

 

The Development Requires

tzsk shorten-url

03/10 2017

1.0.2

1.0.2.0 https://github.com/tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  Sources   Download

MIT

The Requires

 

The Development Requires

tzsk shorten-url

15/03 2017

1.0.1

1.0.1.0 https://github.com/tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  Sources   Download

MIT

The Requires

 

The Development Requires

tzsk shorten-url

02/03 2017

1.0.0

1.0.0.0 https://github.com/tzsk/shorten-url

Google URL Shortener and Expander for Laravel 5.1 and Above.

  Sources   Download

MIT

The Requires

 

The Development Requires

tzsk shorten-url