waavi / url-shortener
Url Shortener for Laravel 5 with support for Google and Bitly drivers.
Installs: 163 170
Dependents: 0
Suggesters: 0
Security: 0
Stars: 62
Watchers: 4
Forks: 33
Open Issues: 9
Requires
- illuminate/config: 5.1.x|5.2.x|5.3.*|5.4.*|5.5.*
- illuminate/support: 5.1.x|5.2.x|5.3.*|5.4.*|5.5.*
- mremi/url-shortener: ^2.0
Requires (Dev)
- mockery/mockery: ^0.9.4
- orchestra/testbench: 3.1.x|3.2.x|3.3.x|3.4.x|3.5.x
- phpunit/phpunit: ^6
README
Introduction
URL shortener package that gives a convenient Laravel Facade for mremi/UrlShortener
WAAVI is a web development studio based in Madrid, Spain. You can learn more about us at waavi.com
Laravel compatibility
Installation and Setup
Require through composer
composer require waavi/url-shortener 1.0.x
Or manually edit your composer.json file:
"require": {
"waavi/url-shortener": "1.0.x"
}
In config/app.php, add the following entry to the end of the providers array:
Waavi\UrlShortener\UrlShortenerServiceProvider::class,
And the following alias:
'UrlShortener' => Waavi\UrlShortener\Facades\UrlShortener::class,
Publish the configuration file, the form view and the language entries:
php artisan vendor:publish --provider="Waavi\UrlShortener\UrlShortenerServiceProvider"
Check the config files for the environment variables you need to set for the selected driver.
Usage
Shorten a url
```php
\UrlShortener::shorten('http://google.com'); // Uses default driver as per config settings
\UrlShortener::driver('bitly')->shorten('http://google.com');
```
Expand a url
```php
\UrlShortener::expand('http://google.com'); // Uses default driver as per config settings
\UrlShortener::driver('bitly')->expand('http://google.com');
```