Bitlys Laravel
Create Shorten URL with Bitly API in Laravel, (*1)
How to install
$ cd yourprojectdirectory
$ composer require arisharyanto/bitlys
- Add the service providers in config/app.php:
Arisharyanto\Bitlys\BitlysServiceProvider::class,
- Run this command in the terminal
$ php artisan vendor:publish --provider="Arisharyanto\Bitlys\BitlysServiceProvider"
- Add access_token from your bitly apps in config/bitlys.php:
'access_token' => 'your access token',
How to use
Just add use Arisharyanto\Bitlys\Bitlys
, (*2)
Bitlys::shorten($longUrl); # Create short bitly url
Bitlys::expand($shortUrl); # Convert shortUrl to longUrl
Bitlys::clicks($shortUrl); # Returns the number of clicks on a single Bitlink
Bitlys::countries($shortUrl); # Returns metrics about the countries referring click traffic to a single Bitlink
Simple !, (*3)
Who is using Bitlys
License
See the license https://github.com/Aris-haryanto/Bitlys-Laravel/blob/master/LICENSE, (*4)
Author
Aris Haryanto
visit my website https://arindasoft.wordpress.com/, (*5)