trendylabs / shortener
API for Laravel 5 to get short URLs via Googl Shortener
Installs: 144
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 1
Type:laravel
Requires
This package is not auto-updated.
Last update: 2024-11-13 19:20:11 UTC
README
API Form Laravel 5 to convert long URLs in Google Shortener format
Installation
Install the package through Composer. Edit your project's composer.json
file by adding:
"require": { "trendylabs/shortener": "dev-master" }
Next, run the Composer update command from the Terminal:
composer update
Add the Service Provider. To do this open your config/app.php
file.
Add a new line to the service providers
array:
TrendyLabs\Shortener\ShortenerServiceProvider::class,
And a new line to the aliases
array:
'Shortener' => TrendyLabs\Shortener\Facade::class,
Now you need to publish config file:
php artisan vendor:publish
Then you can edit your Google API Keys
Usage
Now you're ready to get short URLs via Googl Shortener:
// get short url \Shortener::short($url); // get Google response \Shortener::response($url);