-
Notifications
You must be signed in to change notification settings - Fork 2
/
.readme
52 lines (32 loc) · 1.03 KB
/
.readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Laravel 5.5 url shortener
## Smattering
URL shortener package with Laravel Package Auto-Discovery.
Madeny always learning . [madeny.me](http://madeny.me)
## Laravel compatibility
Laravel | translation
:---------|:----------
5.5.x | 5.5.dev
## Installation and Setup
Require through composer
composer require madeny/url-shortener
Or manually edit your composer.json file:
"require": {
"madeny/url-shortener": "1.0"
}
Config: .env to have this
for bitly driver:
URL_SHORTENER_BITLY_USERNAME=username
URL_SHORTENER_BITLY_PASSWORD=password
for google driver:
URL_SHORTENER_GOOGLE_API_KEY=apikey
## 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');
```